complexType with empty sequence : sequence « XML Schema « XML






complexType with empty sequence



File: Schema.xsd

<?xml version="1.0" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.java2s.com/statement"
  xmlns="http://www.java2s.com/statement">
  
    <xs:attribute name="number" type="xs:ID" />
  <xs:attribute name="name"   type="xs:string" />
  <xs:attribute name="type"   type="xs:string" />

  <xs:element name="statement">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="customer" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="customer">
    <xs:complexType>
      <xs:sequence />
      <xs:attribute ref="number" />
      <xs:attribute ref="name"  />
      <xs:attribute ref="type" use="optional" default="normal" />
    </xs:complexType>
  </xs:element>

</xs:schema>

 








Related examples in the same category

1.Reference group in a sequence
2.sequence with unbounded elements
3.All inner elements in a sequence are referenced
4.Anonymous complexType with sequence
5.Nested sequence
6.Nested complexType and sequence
7.sequence with only one element