XML.HTMLTeacher.Com
[Search] [Contact] [Sitemap]
XML
[Main]
[Schema]
[Annotations]
[Classes]
[XHTML]
[XML]
[CSS]
[Design]
[Programming]
[Marketing]

Overview
* Annotations are simply processing instructions or comments about the schema or one or more elements stated within the schema.

* Annotations may be declared immediately after the xsd:schema element and/or after individual elements.
  • If declared immediately after the xsd:schema, the annotation will be perceived to be about the entire document.


  • If declared after an individual element(s), the annotations are perceived to be information about that/those element(s.)
* Annotations may be declared for both the schema element and individual elements within the schema.

<annotation> Properties
* Annotations have two properties: <documentation> and <appinfo>. Annotations may carry one possible attribute, id. <appinfo> may carry one possible attribute, source. <documentation> may carry two possible attributes, URI and xml:lang.
    <documentation> Examples
    Example annotation within the schema element for human readability using the <documentation> property:

    <xsd:schema
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:annotation>
    <xsd:documentation>

    Any appropriate comments, such as: "This schema will be used to validate the XML documents associated with it."

    </xsd:documentation>
    </xsd:annotation>

    Schema content

    </xsd:schema>
Example annotation within any element for human readability using the <documentation> property:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:element name="product" type="ProductType">
    <xsd:annotation>
    <xsd:documentation>

    Any appropriate comments, such as: "This schema will be used to validate the XML documents associated with it."

    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>

    Schema content

    </xsd:schema>
    <appinfo> Examples
    Example annotation within the schema element for human readability using the <documentation> property:

    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:annotation>
    <xsd:appinfo>

    Application information for processing.

    </xsd:appinfo>
    </xsd:annotation>

    Schema content

    </xsd:schema>
Example annotation within any element for application processing using the <appinfo> property:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:element name="product" type="ProductType">
    <xsd:annotation>
    <xsd:appinfo>

    Application information for processing.

    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>

    Schema content

    </xsd:schema>

All materials, tutorials and content are copyrighted by HTMLTeacher.Com.
Any use of any material, tutorials and/or content provided by this site is prohibited without expressed written consent of the author.

Copyright ©2003 HTMLTeacher.Com and Sonia Weimann