The element Element
An element type, whose XML representation is the element
element, serves two purposes. The first is to constrain the value of a corresponding element in an
XML instance. The second is to locate,
in a content model (specified by a complex
type), where elements of a given type are permitted.
To constrain the value of an element, the element type associates a name with a simple type or a complex type. In the trivial
case, the simple type is just a built-in
datatype:
<xsd:element name="anInteger" type="xsd:integer"/>
Frequently, the simple type is constrained for business reasons:
<xsd:element name="anInteger">
<xsd:simpleType>
<xsd:restriction base="xsd:integer">
<xsd:maxInclusive value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
The sequence element
provides a good example of how element element
providing content model location information.
|