Rational Developer for System z
Enterprise PL/I for z/OS, Version 4.2, Language Reference

XMLATTR and XMLOMIT attributes

The XMLATTR and XMLOMIT attributes specify the use of XML attributes and the omission of null values in the XML that is generated by using the XMLCHAR built-in function.

Note:
The compiler ignores XMLATTR and XMLOMIT unless a structure that contains fields using them is passed to XMLCHAR.

XMLATTR attribute

The XMLATTR attribute indicates that the field is presented as an attribute of its containing structure in the XML output that is generated by XMLCHAR.

XMLATTR is invalid with any of the following elements:

XMLOMIT attribute

The XMLOMIT attribute indicates that the field must be omitted from the XML output that is generated by XMLCHAR if the field is either of the following data items:

XMLOMIT is invalid with any of the following elements:

Example of using XMLATTR and XMLOMIT

The following code shows a declaration of a structure with the XMLATTR and XMLOMIT attributes and also the output you get by using XMLCHAR with that structure:

    dcl
       1 order
         2 orderNr           char(20) init('1729'),
         2 customer,
           3 id              xmlattr fixed bin(31) init(2917),
           3 name            xmlattr char(32) init('jakob'),
           3 firstname       xmlattr char(24) init('michael'),
           3 partno                  fixed bin(31) init(1367),
           3 special         xmlomit char(35) init('');
    <order>
      <orderNr>1729</orderNr>
        <customer id=2917 name='jakob' firstname='michael'>
        <partno>1367</partno>
      </customer>
    </order>

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)