6.4. Annotating Elements

Annotations are a great way to make notes about element types, attribute types, and almost any other element in an XML schema document. An annotation provides what a developer would typically call a “comment” to the XML schema document. Comments destined for developers are stored in a documentation subelement. appinfo subelements support automated processing of annotations—a discussion beyond the scope of this chapter.

Documentation in an XML schema document comes in two forms: annotations and comments. An annotation takes the form of an annotation element. The following annotation, which annotates the schema element, comes from the XML schema document address.xsd:

 <xsd:annotation> <xsd:documentation xml:lang="en"> ...

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.