XMLParse

(Engine-Level Function)

Description: Parses the supplied XML using the specified XML Processor.
Returns: Numeric error code
Usage: Script Only.
Function Groups: XML
Related to: XMLProcessor | XMLAddSchema | XMLWrite | XMLCloneNode | XMLCreateNode | XMLDeleteMember | XMLGetNode | GetXMLNodeArray
Format: XMLParse(XMLProcessorHandle, XMLin [, ErrorMessageOut, XMLNodeTreeOut, NamespaceDictionary ])
Parameters:  
XMLProcessorHandle  
Required. A valid processor, as returned by the XMLProcessor function.
XMLin
Required. The XML text to be parsed. May be either text or a valid stream. If the text supplied (either in the text value or the stream) is identifiable as a URL, the XML is fetched from that URL.
ErrorMessageOut    
A text parameter into which a return error message may be placed.
XMLNodeTreeOut
Must be a variable into which the XMLNode tree, created by parsing the XML successfully, will be placed.
NamespaceDictionary
(Return value) A dictionary of namespaces and prefixes found in the parsing of the XML.
Comments:

The XML may be either a stream or a text value. Returns 0 if it succeeds. Otherwise returns a numeric specifying a Windows error code and sets the variable named in the optional ErrorMessageOut parameter to a text error message.

Passing a very large text value to the function will result in an error. To avoid this, convert the text value to a stream using BuffStream().

In versions of VTS prior to release 10, it is necessary to explicitly slay the XMLNodeTree (the XMLNodeTreeOut parameter to XMLParse) when you are finished with it

The output parameter, XMLNodeTreeOut, will receive a valid XMLNode tree from a validating processor even if validation fails, so long as the XML can be parsed. A valid "XMLNodeTreeOut" with a valid "ErrorMessageOut" indicates a parse-able message that fails validation.

A helper function, GetXMLNodeArray, can be used on the result to extract an array of XMLnodes matching a given type name.