DB2 Version 9.7 for Linux, UNIX, and Windows

Effect of validation on XML decomposition results

Annotated XML schema decomposition does not require input documents to be validated, but validation before or during decomposition is recommended, because it has several benefits.

You can perform validation before decomposition (using the XMLVALIDATE SQL/XML function), or during decomposition as part of the call to the xdbDecompXML stored procedure or the DECOMPOSE XML DOCUMENT command. Validating the XML documents being decomposed ensures that:

Validating the input documents against the registered XML schema is recommended, because the decomposition process assumes that input documents are valid according to the corresponding annotated schema. If the validation is not performed and the input documents are invalid, decomposition can insert different rows for the same input document (compared to when validation is performed, for reasons such as entity resolution or default attribute additions), or the decomposition might yield unexpected results. The results of and the side effects on existing data from decomposing an invalid document are undefined.

Note that errors in the schema, such as non-deterministic content models, or incorrect type derivations can cause the decomposition process to fail when validation is performed during decomposition. Verify that your annotated schema is correct and re-register the schema before attempting the decomposition again.