The complex property
@XMLRootElement provides
naming and data-type details about the root XML element, which is
the topmost, most inclusive element in the XML string. The property
fields are as follows:
- name
- The name of the root XML element. The default value is the name
of the Record part.
If you are writing a record to an XML string,
the value of the property field is assigned to the topmost element
in the XML string. If you are reading an XML string into a record,
the EGL Runtime issues a 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 root 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 is assigned.
In this case, the EGL Runtime assigns a namespace prefix
- If you are reading an XML string into a record, a RuntimeException occurs
if the element is not in the specified namespace, whether the namespace
in the XML string is specified by a prefix or by a namespace default
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, and the element is not in a namespace
- If you are reading an XML string into a record, a RuntimeException occurs
if the element is in a namespace
- nillable
- A Boolean value that 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.