LoadXml Method (XDATA)


9.8A

 

The LoadXml method loads XML data into a XDATA object. The input data can be loaded directly from a DIM variable or from a specified file that contains a valid XML stream. The new XML data replaces all currently existing data in the XDATA object. The method uses the following format:

 

[label]

{object}.LoadXml

[GIVING {return}] using *Data={data}[,*Options={mask}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. An XDATA object.

return

Optional. A Numeric Variable that receives a value to signify a pass or fail condition for the method execution.

data

Required. A Character String Variable or literal that that specifies a fully qualified path and file name that contains the XML data stream. Additionally, the {data} string value can be the actual XML data stream.

mask

Optional. A Numeric Variable or decimal number that specifies a bit mask value to control the operations of this method.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. The ZERO flag is set if the {return} value is zero.

  2. The OVER flag is set TRUE if the {return} variable is too small where the returned value is truncated.

  3. The EOS flag is always cleared.

  4. The *OPTIONS {mask} values are defined as follows:

  5.  

    Value

    Description

    0x1

    This bit value indicates that the {data} method parameter contains a path and file name which contains the XML data to be loaded.

    0x2

    Open a XML file in read only mode.

     

  6. The {return} value is a zero if the method execution is successful. Otherwise, a non-zero value is returned to indicate an error has occurred. See the XDATA Method Return Values for more details.

  7. This method can return these values:

  8.  

    Value

    Meaning

    0

    XDATA_ERR_NONE (Success)

    1

    XDATA_ERR_NO_MEM

    12

    XDATA_ERR_OPEN_FAILED

    13

    XDATA_ERR_PARSER_CREATE

    14

    XDATA_ERR_PARSE

 

 

See Also: XDATA, XDATA Methods, Method Syntax



PL/B Language Reference LoadJson Method (XDATA) MoveToNode Method (XDATA)