For the situation where the XML document has XML elements or attributes
that are not needed for assignment to the subfields of an RPG data
structure, you can use the
allowextra option to indicate
whether this is considered an error. XML data is considered to be
extra in the following circumstances:
- For XML data matching an RPG data structure, if non-whitespace
text content is found.
- For XML data matching an array subfield of an RPG data structure,
if the number of XML elements is greater than the dimension of the
RPG subfield array.
- For XML data matching an RPG scalar variable (neither data structure
nor unindexed array), if the XML element contains child elements or
attributes, other than the special formatting attributes allowed for
some data types (see Rules for transferring XML data to RPG variables).
If unexpected XML data is found, and 'allowextra=yes' is not specified,
the operation will fail with status 00353 (XML does not match RPG
variable).
Warning: At any time, XML attributes for
non-data-structure XML elements elements may be subject to interpretation
by the RPG runtime. Currently, "fmt" and "adjust" are already being
interpreted by the RPG runtime for some target data types. Support
for other attributes may be added at any time, possibly even through
PTFs. If an attribute is being ignored by option 'allowextra=yes',
and that attribute becomes meaningful for the RPG runtime, it may
affect the handling of the data.
- no indicates that the XML elements
used to set the RPG variable or array elements must contain only the
data necessary to set the variable.
- yes indicates that additional XML data will be ignored.