XMLAttribute annotation

XMLAttribute provides details for a Record field that represents an XML attribute.

EGL package name

eglx.xml.binding.annotation

Example use
See “Correspondence between an XML string and an EGL variable.”
Annotation detail
Record XMLAttribute type Annotation {targets = [ ElementKind.fieldMbr ]}
   name string  = "##default";
   namespace string = "##default";
   required boolean = false;
end
Annotation fields
name
The name of the XML attribute. The default value is the name of the record field.

If you are writing a record to an XML string, the value of the property field is assigned to the attribute in the XML string. If you are reading an XML string into a record, the EGL Runtime issues a RuntimeException if a mismatch is found between the actual and expected attributes.

namespace
The XML namespace associated with the XML attribute. If you are writing the record to an XML string, the possibilities are as follows:
  • If you specify a namespace, the EGL Runtime places the attribute in that namespace, assigning a prefix to the attribute name
  • If you do not specify a namespace, the attribute is not in any namespace

When reading an XML string into the record, the EGL Runtime issues RuntimeException if a mismatch is found between the actual and expected namespace status of the attribute.

required
Indicates whether the attribute must be specified in the XML.
Comments
Compatibility

Table 1. Compatibility
Target Issue
Java No issues.
JavaScript No issues.