XMLParse() function

The XMLParse() function converts a value of type varchar or nvarchar to a value of type XML, which is the Netezza Performance Server compiled representation of an XML object (by default, white space is stripped). The inverse function is XMLSerialize().

The XMLParse() function is not intended for parsing external data and loading it into XML columns. Though it is possible to call the XMLParse() function as a part of an external table load, the resulting XML data type is stored as a varchar or nvarchar value that has a maximum size of 64,000 bytes.

Syntax

The XMLParse() function has the following syntax:
XML = XMLParse(varchar input)
XML = XMLParse(nvarchar input)

The input value specifies a varchar or nvarchar representation of an XML input object.

Returns

The function returns the Netezza Performance Server compiled representation of an XML object. If the input varchar or nvarchar value resolves to null, the function returns null.

Example

Consider the following example:
select XMLParse('<Parent>Parent Text</Parent>');
 XMLPARSE
----------
 XML
(1 row)

The output is a value of type XML that is the compiled representation of the XML object <Parent>Parent Text</Parent>.