Categories:
Semi-structured Data Functions (Parsing)

CHECK_XML

Checks the validity of an XML document. If the input string is NULL or a valid XML document, the output is NULL. In case of an XML parsing error, the output string contains the error message.

Examples

Locate records with broken XML:

SELECT *, CHECK_XML(xml_str) FROM my_table WHERE CHECK_XML(xml_str) IS NOT NULL;