Reference Guide > TDV SQL Support > Data Types > XML
 
XML
TDV support for the XML data type complies with the ANSI 9075 section 14 XML specification.
Syntax
XML [ ( { DOCUMENT | CONTENT | SEQUENCE }
[ ( ANY | UNTYPED | XMLSCHEMA schema-details ) ]
    ) ]
Remarks
schema-details is of the following form:
URI target-namespace-uri [ LOCATION schema-location ] [ { ELEMENT element-name | NAMESPACE namespace-uri [ ELEMENT element-name ] } ]
| NO NAMESPACE [ LOCATION schema-location ] [ { ELEMENT element-name | NAMESPACE namespace-uri [ ELEMENT element-name ] } ]
 
target-namespace-uri, schema-location, and namespace-uri are STRING literals that represent valid URIs.
element-name is any valid identifier.
Examples
CAST ('<item></item>' as XML (SEQUENCE))
CAST ('<entity></entity>' as XML (SEQUENCE(ANY)))
PROCEDURE item()
BEGIN
DECLARE item XML (SEQUENCE(XMLSCHEMA URI 'http://www.w3.org/2001/XMLSchema-instance' LOCATION 'http://www.w3.org/2001/XMLSchema-instance' ELEMENT xsi));
END