none
maxoccurs/minoccurs where to specify?

    Question

  • Hi we have xsd as follows

    <xsd:element name="books"> <xsd:complexType> <xsd:sequence minOccurs="1" maxOccurs="unbounded"> <xsd:element ref="book1" minOccurs="1" maxOccurs="unbounded"/>

    <xsd:element ref="book2" minOccurs="1" maxOccurs="unbounded"/>

    </xsd:sequence>

    </xsd:complexType> </xsd:element>

    Will this be complied as

    <books>
      <book1/><book2><book1/><book2/><book1/><book2/><book1/><book2/>..
    </books>

    OR

    <books> <book1/><book2> </books>

    <books>
      <book1/><book2>
    </books>

    pl specify the correct result & why?

    Wednesday, June 11, 2014 6:43 AM

All replies

  • The Correct Result would be

    <books>
    
    <book1 />
    
    <book1 />
    
    <book2 />
    
    <book2 />
    
    
    
    </books>
    
    <books>
    
    <book1 />
    
    <book1 />
    
    <book2 />
    
    <book2 />
    
    
    
    </books>

    Morten la Cour

    • Proposed as answer by Ravindar Thati Thursday, June 12, 2014 12:31 PM
    Wednesday, June 11, 2014 5:29 PM