Jump to content

Chrille

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Chrille

  • Rank
    Newbie
  1. Chrille

    Unordered Elements

    Hello,I found another approach that seems to fulfill my intentions. With the use of the xs:choice element inside of the xs:sequence tag I can specify the maxOccurs attribute to "unbounded" and choose between the included elements: <xs:element name="Panel" maxOccurs="unbounded"> <xs:complexType mixed="true"> <xs:sequence> <xs:choice maxOccurs="unbounded"> <xs:element name="Button" minOccurs="0" maxOccurs="unbounded"> ... </xs:element> <xs:element name="Image" minOccurs="0" maxOccurs="unbounded"> ... </xs:element> </xs:choice> </xs:sequence> </xs:complexType></xs:element> I don't know if this is a preferrable solution but it seems to work anyway.
  2. Chrille

    Unordered Elements

    Thank you for your reply!I tried the xs:all element instead, but as I understand it this element is restricted to 0 or 1 occurences of the button and image element. How would I use this element to permit an unbounded amount of button and image elements?Thanks in advance!
  3. Hi, I'm working on an XML definition of a web application and I need to create an XML Schema for this definition. However I'm having trouble with the order of the elements. With the xs:sequens tag I can get a specified order of the selected elements as the following code shows: <xs:element name="Panel" maxOccurs="unbounded"> <xs:complexType mixed="true"> <xs:sequence> <xs:element name="Button" minOccurs="0" maxOccurs="unbounded"> ... </xs:element> <xs:element name="Image" minOccurs="0" maxOccurs="unbounded"> ... </xs:element> </xs:sequence> </xs:complexType></xs:element> This makes it possible to create a Panel element and within it add Button and Image elements in sequence where the Button element/elements have to be added before the Image element/elements. But how do i define in the XML Schema that the Button and Image element can appear in whatever order and numbers as in the example below? <Panel> <Image/> <Button/> <Button/> <Image/> <Button/> ...</Panel> I cant't find the specified functionality and I am thankful for all the help I can get.
×
×
  • Create New...