7.5. The annotation Element

The annotation element provides a mechanism for documenting most other schema elements. Unlike an XML comment, which looks like <!-- comment text -->, the annotation is part of the schema component. An annotation provides documentation intended for human consumption in one or more languages, as well as documentation intended for programmatic consumption, such as meaningful URIs.

Listing 7.3 demonstrates the use of an annotation that describes a Private Mail Box (PMB). The following example contains an annotation of pmb.

Listing 7.3. An annotation Element (address.xsd)
 <xsd:element name="pmb" type="xsd:string" substitutionGroup="addressLine" minOccurs="1" maxOccurs="1"> <xsd:annotation id="customerRecord.annotation.pmb"> ...

Get XML Schema Complete Reference, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.