Ignoring Elements in XSD

J

Jody Greening

How do I write a schema that is only validating elements: 1,4,7,8,9 and
ignores every other element? I also need to not to care about the order
of the elements or how many are in between elements that I am trying to
validate.

XML:
<root>
<element1 />
<element2 />
<element3 />
<element4 />
<element5 />
<element6 />
<element7 />
<element8 />
<element9 />
</root>

XSD:
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="element1">
<xs:element name="element4">
<xs:element name="element7">
<xs:element name="element8">
<xs:element name="element9">
</xs:sequence>
</xs:complexType>
</xs:element>

Basically I need it to ignore ANY elements outside of my Schema
declaration and I may not know where they are located in the XML doc.

Thanks.
Jody
 

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,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top