Ignoring Elements in XSD

Discussion in 'XML' started by Jody Greening, May 9, 2005.

  1. 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
     
    Jody Greening, May 9, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,108
    Markus
    Nov 22, 2005
  2. Rick Razzano

    XSD document for XSD defintion

    Rick Razzano, Sep 26, 2003, in forum: XML
    Replies:
    1
    Views:
    491
    C. M. Sperberg-McQueen
    Sep 26, 2003
  3. Replies:
    1
    Views:
    863
    Martin Honnen
    Jan 14, 2004
  4. Peter Aberline

    xsd:any as a child of xsd:all

    Peter Aberline, Apr 5, 2004, in forum: XML
    Replies:
    0
    Views:
    794
    Peter Aberline
    Apr 5, 2004
  5. Bernd Oninger
    Replies:
    1
    Views:
    528
    Henry S. Thompson
    Jun 30, 2004
Loading...

Share This Page