Struct Annotations for XML
When converting between XML and Structs using xmlToStruct or structToXml, you can set and retrieve annotations that provide information that guides the conversion (or reverse conversion).
Use the $tags function to set or get the value of an annotation for a specific Struct. For example:
- Get the value of the
xmlClass
annotation for Struct memberdiv
:vClass = MyStruct->div->$tags->xmlClass
- Set the
xmlClass
of Struct member div toelement
:MyStruct->div->$tags->xmlClass = "element"
Tag | Values | Comments |
---|---|---|
xmlClass
|
|
XML construct from which, or to which, the Struct member is converted. |
xmlNamespaceURI
|
Value of the namespace
string |
URI of the namespace of this element or attribute |
xmlNamespaceAlias
|
Value of the alias string
|
Alias (or prefix) used on this element to specify the namespace. |
xmlVersion
|
Value of the version
attribute in the <?xml … ?> declaration |
On top level Struct only |
xmlEncoding
|
Value of the encoding
attribute in the <?xml … ?> declaration |
On top level Struct only; optional. |
xmlStandAlone
|
Value of the |
On top level Struct only; optional. |
xmlDataType
|
Data type | On Structs for attributes and attribute
declarations, unless it is CDATA , which is the default. Set on elements, only if
Note: During conversion from Struct to XML it is
possible to influence the output format by setting |
xmlTypeNamespace
|
Namespace of URI of a schema-defined data type | On attributes and elements when
/schema is used and the schema has defined the data type with a namespace. |
xmlTypeCategory
|
simple
|
On attributes and elements when
/schema is used and the data type comes from a schema. |
xmlAttrMode
|
#IMPLIED
|
On Structs for attribute list declarations |
xmlPublicID
|
Formal Public Id used to identify the DTD | On Structs for DOCTYPE, entity declarations, and notation declarations |
xmlSystemID
|
URI for the file containing the DTD | On Structs for DOCTYPE, entity declarations, and notation declarations |
xmlNotation
|
Name of notation declaration | On Structs for unparsed external entity declaration |
Namespace declarations also affect the annotations for elements and attributes. For more information, see XML Namespace Declaration.