Home >Online Product Documentation >Table of Contents >Example
Example
In an XML Schema, you might have a comment node such as the following:
<xsd:schema ...>
<!-- The following element is .... -->
<xsd:element name="..."/>
|
The contents of a comment node have meaning only when a person reads them. However, the contents of annotation nodes can be operated on. For example:
<xsd:schema ... >
<xsd:element name="foo">
<xsd:annotation>
<xsd:documentation language="en">
This is a <b>foo</b> element. Use it for ...
</xsd:documentation>
<xsd:documentation language="jp">
xksnjgfyre fvhfdbvhjds
</xsd:documentation>
</xsd:annotation>
</xsd:element>
...
|
You can apply an XSLT stylesheet to this XML Schema document. The stylesheet could generate an HTML manual by extracting the Documentation nodes in the desired language:
<xsl:stylesheet ... >
<xsl:template match="xsd:element">
<xsl:apply-templates select=
"xsd:annotation/xsd:documentation[@language='en']"/>
</xsl:template>
...
|