Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : XMLPARSE

XMLPARSE
Initiates the parsing of an XML document. (C)
Invocation
CALL XMLPARSE(docname, validate, docsource, docdata).
 
Y – Validate the document against a DTD.
N – Do not validate; check for wellformedness only.
STORAGE – The document resides in memory.
URL – The document is retrieved by means of a URL.
FILE – The document is retrieved from a local file.
STRING – The document resides in a string.
STORAGE – The pointer to the memory address holding the document.
URL – The URL from which to retrieve the document.
FILE – The name of the file containing the document.
STRING – The string holding the document.
Usage Notes
The encoding of an XML document is defined by the XML document header. The encoding parameter in the header is always honored. If one is not provided, then the parser probes the header of the document to detect whether the document is ASCII or UNICODE. The parse supports standard ISO encoding names. On z/OS we also support IBM extensions to the encoding name pool, such as ibm037-s390, which represents the US EBCDIC code page. For example:
<?xml version=’1.0’ encoding=’ibm037-s390’?>
When passing XML documents as string from a rule, the string is automatically converted to UTF-16. As a result, specifying an encoding is optional. However, should you chose to specify an encoding in the XML document header then you must specify UTF-16.
The parser on z/OS can access XML documents from normal z/OS data sets and from UNIX System Services (USS) files. You must use a USS-like file name when referring to the file. For example, if the data-set name is MYUSERID.TEST.XML, name the file MYUSERID/TEST/XML.

Exceptions
 
An error occurred during the parsing of the XML document. For more information, inspect the return value of GETENDMSG.
Example
The following example shows XML in a mapped data area being parsed with the STORAGE operand.
CALL XMLPARSE(’MYDOC’, ’N’, ’STORAGE’, MAPAREAPOINTER);

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved