XML Schema 0- unordered set containing multiple occuring element

Discussion in 'XML' started by Naresh Agarwal, Mar 7, 2004.

  1. Hi

    How can I write a XML Schema for a XML document, which contains an
    unordered set of elements and one of these element, who is of complex
    type can have multiple occurences.

    xsd:sequence provides ordered set. xsd:all provides ordered set but
    cardinality of it elements cann't be more than one. so none of these
    can be used.

    Any help will be greatly appreciated.

    thanks,
    Naresh Agarwal
    Naresh Agarwal, Mar 7, 2004
    #1
    1. Advertising

  2. Naresh Agarwal wrote:

    > How can I write a XML Schema for a XML document, which contains an
    > unordered set of elements and one of these element, who is of complex
    > type can have multiple occurences.
    >
    > xsd:sequence provides ordered set. xsd:all provides ordered set but
    > cardinality of it elements cann't be more than one. so none of these
    > can be used.


    Using <xs:choice> with maxOccurs should allow you to describe the
    content model you want to have but I don't think the W3C XML schema
    language will allow you to restrict the content to an unordered set
    where one element can occur several times, with the choice all elements
    can occur multiple times.
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Mar 7, 2004
    #2
    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.

Share This Page