The @XMLElement complex property
is specified on a record field and identifies characteristics of an
XML element. The property includes the following fields:
- name
- The name of the XML element. 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 element in the
XML string. If you are reading an XML string into a record, the EGL
runtime code issues an RuntimeException if
the name of the topmost XML element does not match the value of the
property field.
- namespace
The XML namespace that is associated with the XML element.
You must specify the namespace even if it is a default namespace.
If
you specify a namespace, the following statements apply:
- If
you are writing a record to an XML string, a namespace prefix
is assigned automatically.
- If you are reading an XML string
into a record, an XMLProcessingException occurs
if the element is not in the specified namespace.
If
you do not specify a namespace, the following statements
apply:
- If you are writing a record to an XML string, a namespace
prefix
is not specified.
- If you are reading an XML string into a
record, an XMLProcessingException occurs
if the element is in any namespace.
- nillable
- A Boolean
value indicates whether the element to be written to
an XML string is nillable. The choices are as follows:
- If the
value is false (the default), the EGL runtime code
does not write an element to the XML string when the content is null.
- If the value is true, an attempt to write a null from the
record to the XML string results in an empty element that includes
the xsi:nil="true" attribute value and has no other
attributes.
The nullable aspect of a record field affects
what occurs
when the EGL runtime code reads an XML string into a record. For more
details, see "Copying an XML string to and from an EGL variable."