The XMLCHAR built-in function dumps data from a structure as XML into
a buffer. It returns the number of bytes written to the buffer.
If the buffer is too small, the structure data is truncated and the number of bytes needed
for the buffer to contain the structure is returned.
 >>-XMLCHAR--(--x--,--p--,--n--)--------------------------------><
|
- x
- Structure-reference.
The structure-reference x must conform to the following rules:
- It must contain only computational data, that is, only string
and numeric data. However, it must not contain any
GRAPHIC or WIDECHAR elements.
- It may contain arrays, but if it is an array itself, it must
be completely subscripted.
- It may contain substructures, but any contained substructure
must not use an asterisk (*) in place of a name. However, an asterisk may be used
as the name of a base element, but in that case, the unnamed element
will not be written to the target buffer.
- p
- Address of target buffer.
- n
- Length of target buffer.
The buffer length must have a computational type and will be converted
to FIXED BINARY(31,0).
It must be nonnegative.
When the XML output is created, it follows these rules:
- When no variable has the XMLATTR attribute, each name in the structure is written out, first enclosed in
"<" and ">" and later enclosed in "</"
and ">".
- When a variable has the XMLATTR attribute, the field
is presented as an attribute of its containing structure.
- When a variable has the XMLOMIT attribute,
the field is omitted if it has a null value.
- Numeric and bit data is converted to character.
- Leading and trailing blanks are trimmed wherever possible.
Note:
By default the names of the variables in the generated
XML output are all in upper case. The CASE(ASIS) suboption of the XML compiler
option can be used to specify that the names appear in the case in
which they were declared.
|
This information center is powered by Eclipse technology. (http://www.eclipse.org)