Question

<xsd:element maxOccurs="1" minOccurs="0" name="cursor">
  <xsd:complexType>
    <xsd:sequence />-------------->?
    <xsd:attribute name="numRows" type="xsd:integer" />
    <xsd:attribute name="id" type="xsd:double" />
    <xsd:attribute name="position" type="xsd:integer" />
    <xsd:attribute name="maxRows" type="xsd:integer" />
 </xsd:complexType>
</xsd:element>

What is the significance of <xsd:sequence /> in above schema? Please help.

Was it helpful?

Solution 2

It means nothing as far as I can tell.

The cursor element can take the 4 attributes ( numRows, id, position and maxRows ) and nothing else.

Taking out the <xsd:sequence/> would have no effect whatsoever.

In general <xsd:sequence> appears around a number of other elements that must appear in the specified order

OTHER TIPS

The <xs:sequence/> is saying that the content of the element (that is, its children) must be an empty sequence of element, that is, there must be no content - the element must be empty (except of course for attributes).

This is the default content model, so it's not necessary to say this, but it often does no harm to be explicit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top