Appendix E. XML Schema Element and Attribute Reference

This appendix provides a full listing of all elements within the XML Schema Structures Recommendation (found at http://www.w3.org/TR/xmlschema-1/). The elements appear in alphabetical order. Each element is described with examples and a table detailing all the attributes used in the element. When attributes are required, it is noted in the attribute listings.

The end of this appendix presents a table of the attributes in the XML Schema Instance namespace that can be used in instance documents.

all

all

The <all> element is used within content model declarations. It indicates that all elements declared within it may appear in the instance document in any order and may appear at most once. The <all> element is used within a <complexType> or <group> element. It can contain <element> or <annotation> elements. Note that when using minOccurs and maxOccurs on <element> declarations within an <all> element, you are restricted to using a maxOccurs of 1 or 0. You can make an element optional by setting the minOccurs to 0. For more information, see §3.8.2 of the Recommendation.

Example

<xs:element name="Rucksack">
   <xs:complexType>
      <xs:all>
         <xs:element name="Sunglasses" type="xs:string" maxOccurs="1" />
         <xs:element name="Sweater" type="xs:string" maxOccurs="1" />
         <xs:element name="Book" type="xs:string" />
         <xs:element name="Lunchbox" type="xs:string" />
         <xs:element name="Flask" type="xs:string" />
      </xs:all>
   </xs:complexType>
</xs:element>

Attributes ...

Get Beginning XML, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.