%XML options for the XML-INTO operation code

Several options are available for customizing the XML-INTO operation. The options are specified as the second parameter of the %XML built-in function. The parameter can be a constant or a variable expression. The options are specified in the form 'opt1=val1 opt2=val2'.

See %XML (xmlDocument {:options}) for more information on how to specify the options.

  • The path option specifies where to locate the desired XML element within the XML document.
  • The doc option specifies whether the first parameter of the %XML built-in function has an XML document, or has the name of a file containing the XML document.
  • The ccsid option specifies the CCSID to be used to parse the XML document.
  • The case option specifies the way that XML-INTO should interpret the element and attribute names in the XML document when searching for XML names that match the the RPG field names and the names in the path option.
  • The trim option specifies whether you want blanks, tabs and line-end characters to be trimmed from the XML data before it is assigned to your RPG variables.
  • The allow missing option specifies how the RPG runtime should handle the situation when the XML document does not have enough XML elements or XML attributes to provide data for all the RPG subfields of a data structure.
  • The allow extra option specifies how the RPG runtime should handle the situation when the XML document has additional XML elements or attributes that are not needed to set the RPG variable.
  • The data subfield option specifies the name of the extra subfield used to handle the situation where there is text data for an XML element that matches an RPG data structure.
  • The count prefix option specifies the prefix for the names of the additional subfields that receive the number of RPG array elements set by the XML-INTO operation.
  • The namespace option controls how XML-INTO handles XML names with a namespace when it is matching XML names to the names in the path option or the subfield names of a data structure.
  • The namespace prefix option allows your RPG program to find out the values of the namespaces that were removed from the XML names when the namespace option was used to remove the namespace from the names.