XSD - proper way to express group of elements...

  • Thread starter unishippers.suckfeed.newshosting.com
  • Start date
U

unishippers.suckfeed.newshosting.com

Hi,
I am wondering what is the best way to express a group of sub-elements not
required to be in any order?
so...

<person>
<height/>
<weight/>
</person>

or

<person>
<weight/>
<height/>
</person>

....are both valid when validated by the XSD Schema file.

Thanks ahead of time,

Jason
 
P

Priscilla Walmsley

Hi Jason,

You can use the xs:all element, as long as each of the children can
appear no more than one time.

For example:

<xs:complexType name="PersonType">
<xs:all>
<xs:element name="height"/>
<xs:element name="weight"/>
</xs:all>
</xs:complexType>

Hope that helps,
Priscilla
 

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,770
Messages
2,569,586
Members
45,088
Latest member
JeremyMedl

Latest Threads

Top