Understanding XML Schema - When In Rome...
(Page 10 of 12 )
Finally, comments. Since a schema definition is a well-formed XML document, you can include as many comments within it as you like, by enclosing each within the standard comment indicators. In addition to this, the XML Schema specification also allows schema authors to include human-readable comments in the <xsd:annotation> element. The following example illustrates this:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:documentation>Hail,
fellow Romans!</xsd:documentation>
</xsd:annotation>
<xsd:simpleType
name="simpleDType">
<xsd:annotation>
<xsd:documentation>This datatype
restricts values to integers between 1
and 10, both inclusive</xsd:documentation>
</xsd:annotation>
<xsd:restriction
base="xsd:integer">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive
value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
Next: Test Drive >>
More XML Articles
More By Harish Kamath, (c) Melonfire