XML Schema problem...Thanks

M

Mavis

If I want to assign different value to different versions as the
followings:

<versions>
<version>
<name> a20 </name>
<value> 10 </value>
</version>

<version>
<name> b40 </name>
<value> 50 </value>
</version>

<version>
<name> others</name>
<value> 5 </value>
</version>
</versions>

I guess it cannot be simplified as below, even if we can use <xs:choice
maxOccurs="unbounded"> to define elements in any order with any
occurrences.. the problem is we cannot identify corresponding value for
each version...

<versions>
<version> a20 </version>
<value> 10 </value>

<version> b40 </version>
<value> 50 <value>

<version> others </version>
<value> 5 </value>
</versions>

Am I right? Could anyone confirm me about this if possible?
Thanks a lot!
 
J

jmcgill

Mavis said:
I guess it cannot be simplified as below, even if we can use <xs:choice
maxOccurs="unbounded"> to define elements in any order with any
occurrences.. the problem is we cannot identify corresponding value for
each version...

<versions>
<version> a20 </version>
<value> 10 </value>

<version> b40 </version>
<value> 50 <value>

<version> others </version>
<value> 5 </value>
</versions>

Am I right? Could anyone confirm me about this if possible?
Thanks a lot!

It is only because of the way you read it that this is distinct from:


<versions>
<value> 50 <value>
<value> 10 </value>>
<value> 5 </value>
<version> a20 </version>>
<version> b40 </version>
<version> others </version>
</versions>


Although you may be able indicate the ordering of each element as a
sequence.

I liked your first version much, much better.
 

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
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top