Annotating a Schema
The xs:annotation element is used to document a schema. It can take two elements: xs:documentation and xs:appInfo, which are used to provide human-readable and machine-readable notes, respectively.
The xs:annotation element can go at the beginning of most schema constructions, including xs:schema, xs:element, xs:attribute, xs:simpleType, xs:complexType, xs:group, and xs:attributeGroup.
Both the xs:documentation and xs:appInfo elements can contain any content, including undeclared elements and attributes. This allows the schema author to insert elements (e.g, HTML elements) to structure or format the documentation.
The sample below shows an annotated XML schema.
The Annotation.xsl file in the Annotation/Demos folder is an XSLT document that can be applied to an annotated schema to create human-readable HTML documentation. The screenshot below shows what it produces when applied to Annotation/Demos/Books.xsd.