Occurrence problem

Discussion in 'XML' started by Martin Perreault, Oct 27, 2004.

  1. Hello,

    I cannot find a schema structure that would accommodate the following
    occurence and ordering restrictions. Please note that this is only an
    example and that a typical RootElement has around 20 children element.


    <xs:element name="RootElement">
    <xs:complexType mixed="true">
    <xs:???>
    <xs:element ref="A" minOccurs="0" />
    <xs:element ref="B" minOccurs="0"/>
    <xs:element ref="C" minOccurs="1"/>
    <xs:element ref="D" minOccurs="1"
    maxOccurs="unbounded"/>
    <xs:element ref="E" minOccurs="1"/>
    <xs:element ref="F" minOccurs="0"/>
    </xs:???>
    </xs:complexType>
    </xs:element>

    In the xml document being validated, elements appear in no particular
    order.

    would anyone have a schema patern that would meet these criteria?

    Thanks

    Martin
     
    Martin Perreault, Oct 27, 2004
    #1
    1. Advertising

  2. (Martin Perreault) writes:

    > <xs:element name="RootElement">
    > <xs:complexType mixed="true">
    > <xs:???>
    > <xs:element ref="A" minOccurs="0" />
    > <xs:element ref="B" minOccurs="0"/>
    > <xs:element ref="C" minOccurs="1"/>
    > <xs:element ref="D" minOccurs="1"
    > maxOccurs="unbounded"/>
    > <xs:element ref="E" minOccurs="1"/>
    > <xs:element ref="F" minOccurs="0"/>
    > </xs:???>
    > </xs:complexType>
    > </xs:element>


    ?? -> all


    --
    Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
    Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
    Fax: (44) 131 650-4587, e-mail:
    URL: http://www.ltg.ed.ac.uk/~ht/
    [mail really from me _always_ has this .sig -- mail without it is forged spam]
     
    Henry S. Thompson, Nov 1, 2004
    #2
    1. Advertising

  3. I think <xs:all> doesn't support "unbounded".

    Martin



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Martin Perreault, Nov 1, 2004
    #3
  4. Hi Martin,

    You're right - you can't use maxOccurs="unbounded" with xs:all.

    Your choices would be to
    1. specify that they must appear in order
    2. use a repeating choice group, which can't enforce that any of the
    elements are required
    3. put in an extra level, e.g. a <DList> element that contains all the
    <D> elements as children.

    Hope that helps,
    Priscilla
    -----------------------------------------------------
    Priscilla Walmsley
    Author, Definitive XML Schema (Prentice Hall PTR)
    http://www.datypic.com
    -----------------------------------------------------

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Priscilla Walmsley, Nov 2, 2004
    #4
    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. =?Utf-8?B?cm9kY2hhcg==?=

    strange login occurrence

    =?Utf-8?B?cm9kY2hhcg==?=, Nov 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    333
    =?Utf-8?B?cm9kY2hhcg==?=
    Nov 3, 2004
  2. Darpan
    Replies:
    3
    Views:
    13,049
    Darpan
    Mar 2, 2005
  3. Jorn W Janneck
    Replies:
    3
    Views:
    2,929
    Jorn W Janneck
    Sep 5, 2003
  4. mrc-1
    Replies:
    0
    Views:
    417
    mrc-1
    Mar 8, 2006
  5. Registered User

    Find first occurrence of string and replace

    Registered User, Oct 16, 2006, in forum: C Programming
    Replies:
    6
    Views:
    493
    Ed Collins
    Oct 18, 2006
Loading...

Share This Page