xsd definition

S

Sandy

Hi,

I want to write one element definition which can contain any number of "A"
or "B" subelements in the XML file in any order.
e.g. the following xml should be allowed

<rootelement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file.xsd">
<A/>
<A/>
<B/>
<A/>
<B/>
<B/>
</rootelement>

How do i write a .xsd to validate this form of XML

<xs:element name="rootelement">
<xs:complexType>
<xs:????? minOccurs="0" maxOccurs="unbounded">
<xs:element ref="A"/>
<xs:element ref="B"/>
</xs:?????>
</xs:complexType>
</xs:element>
 
C

commercial

It depends on who validates.

Do you sign a contract ?

Do you use your or the other party's scheme.
 
G

Guest

Sandy a écrit :
Hi,

I want to write one element definition which can contain any number of "A"
or "B" subelements in the XML file in any order.
e.g. the following xml should be allowed

<rootelement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file.xsd">
<A/>
<A/>
<B/>
<A/>
<B/>
<B/>
</rootelement>

How do i write a .xsd to validate this form of XML

<xs:element name="rootelement">
<xs:complexType>
<xs:????? minOccurs="0" maxOccurs="unbounded">
<xs:element ref="A"/>
<xs:element ref="B"/>
</xs:?????>
</xs:complexType>
</xs:element>
Have a look here:
http://www.w3schools.com/schema/default.asp
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top