null or complex type element

M

MD

I am trying to define the schema for xml document.

One of elements can have null / complex type x/ y

<coordinate>
<x>5</x>
<y>1</y>
</coordinate>

or

<coordinate>
</coordinate>


I tried with union but without the lack since it only works with simpletype

any help is appreciated.

MD
 
J

Joe Kesselman

One suggestion: Coordinate's content is a sequence of x and y; the
sequence has minoccurs of 0 (may be absent) and maxoccurs of 1 (may not
be repeated).
 
M

M D

I also need to specify that x,y is a pair( if one exists the other has to be
there, too)
 
J

Joe Kesselman

M said:
I also need to specify that x,y is a pair( if one exists the other has to be
there, too)

Doesn't wrapping them in sequence do that by default?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,005
Messages
2,570,264
Members
46,859
Latest member
HeidiAtkin

Latest Threads

Top