Maps to a UML Comment with or without the stereotype XSDannotation. The documentation content maps to the UML Comment body (name).

“documentation” maps as a UML comment, as outlined below:

  • the “content” value - the comment name.
  • the “xml:lang” value – the tag “xml:lang” value.
  • the source value – the tag ”source” value.

“appinfo” maps as a tag value with the name “appInfoSource”:

  • the “source” value will be the tag value.
  • the “content” will be documentation for the tagged value.

When several annotation nodes appear on one element node, mapping shall be done as follows:

  • the “documentation” text shall be merged into one UML comment with merged content, but the “content” and “xml:lang” tag values shall represent only the first matched values.
  • “appInfo” shall have “content” merged into one tag “appInfoSource” comment, but the tag value shall represent the “appinfo” matched first.

annotation XML representation summary
<annotation
	id = ID
	{any attributes with non-schema namespace …}>
	Content: (anninfn I dorumpnrarioWl.
</annotation>
<appinfo
	source = anyURI>
	Content: ({any})*
</appinfo>
<documentation
	source = anyURI
	xml:lang = language>
	Content: ({any})*
</documentation>
XML representations of three kinds of annotation
<xs:simpleType fn:note="special">
	<xs:annotation>
		<xs:documentation>A type for experts only</xs:documentation>
<xs:appinfo>
			<fn:specialHandling>checkForPrimes</fn:specialHandling>
</xs:appinfo>
	</xs:annotation>
annotation UML model example.
annotation XML code sample
<xs:schema xmlns:nm = "http://nomagic.com" xmlns:xs = "http://www.w3.org/2001/XMLSchema" targetNamespace = "http://nomagic.com">
<xs:annotation >
		<xs:appinfo source = "infoSource">infoContent</xs:appinfo>
<xs:documentation source = "documentation source" xml:lang = "EN">the documentation for this schema</xs:documentation>
</xs:annotation>
</xs:schema>