Hello,
I have a CLOB column that should contain an XML which conforms to a registered XSD schema. However, there might also be cases, in which the CLOB content violates the XSD or is not even wellformed XML at all. Now I am trying to find a way to either
- identify all records, for which the CLOB contains well-formed XML that validates against my schema (find all "good" records) , or
- find all the other records (those with either no XML at all, malformed XML, or XML that does not validate against the XSD) (find all "exceptions")
The problem is that all XML-validation methods I know of (e.g. isXmlValid or XmlType.isSchemaValid) require an XmlType instance, and that records, for which no proper XmlType can be constructed from the CLOB, because the CLOB does not contain well-formed XML, will cause an exception, rather than just returning false or NULL or something else I could filter out.
Is there a way to do something like
SELECT * FROM MYTABLE where <MY_XML_COL is wellformed XML> and <MY_XML_COL validates against 'blabla.xsd'>
without getting an ORA-31011 or whatever other kind of exception as soon as there is a row that does not contain proper XML?
Thank you...