How does XML DB handle XML Schema Validation ?
In order to validate an XML document against an XML Schema using Oracle XML DB the XML Schema must first be registered with XML DB using the method registerSchema provided by the package DBMS_XMLSCHEMA.
XDB provides two types of schema validation, 'Lax' Validation and 'Strict' Validation.
'Lax' validation takes place whenever a schema based document is converted from it's textual representation into the XML DB internal object model. Errors caught by this validation will be prefixed with 'ORA'.
'Stict' validation takes place when the XMLType methods schemaValidate() or isSchemaValid() are invoked.
The schemaValidate() method throws an exception with an error message indicating what is wrong it encounteres an invalid document. The error message associated with the exception will be prefixed with LSX.
The isSchemaValid() method returns true or false, depending on whether or not the document is valid. It cannot return any information about why the document is invalid.
The reason for having both the Lax and Strict validation models is that Strict validation is much more expensive in terms of CPU and memory usage than Lax validation.