path

The path option is used for DATA-INTO and XML-INTO.

The path option specifies the path to the item as it appears in the document, with items separated by forward slashes. For example, if this option is path=main/info/name, the parser will expect the outermost item to be "main", a child of "main" to be "info", and a child of "info" to be "name". If no item can be found, the operation will fail with status 00353 (the XML document does not match the RPG variable) or 00356 (Document for DATA-INTO does not match th RPG variable).
Note: The value of the "allowmissing" option has no effect on this situation.
Note: The path option is required when %HANDLER is used to specify an array-handling procedure.
Default: When the path option is not specified, the search for the item matching the RPG variable depends on the type of the variable.
  • For non-array variables, the outermost item is expected to have the same name as the RPG variable.
  • When the operation code is XML-INTO, for array variables, the outermost XML element is expected to have child elements with the same name as the RPG array variable. The outermost XML element can have any name. When the operation code is DATA-INTO, for array variables, the outermost item is expected to match the array.
Note:
  1. If the variable is a qualified subfield, only the name of the subfield is used in determining the path to the item in the document. For example, if the variable is DS.SUB1, the default is to expect the outermost item in the document to be called "sub1".
  2. The path specified by this option is case sensitive. It must be in the same case as the matching items in the document unless the case option is also specified.