The complex property
@XMLElement 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 issues an RuntimeException if the
name of the topmost XML element does not match the value of the property
field.
- namespace
- The XML namespace (if any) that is associated with the XML element.
You must specify the namespace explicitly 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 choice is as follows:
- If the value is false (the default), the EGL Runtime 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 attribute value
xsi:nil="true"
and has no other
attributes
The nullable aspect of a record field affects what occurs
when the EGL Runtime reads an XML string into a record. For details,
see Copying an XML string to and from an EGL variable.
- cdata
- A Boolean value indicates whether the element to be written to an XML string is to be wrapped in a CDATA tag. The choice is as follows:
- If the value is false (the default), the EGL Runtime does not wrap the element string in a CDATA tag
- If the value is true, the EGL Runtime wraps the element string in a CDATA tag