Use of DocumentVerification
To use DocumentVerification for input or output, you must enable the setting and add the data types to the Data Audit Settings view.
Except for the Well-Formed option, the DocumentVerification card setting must not be used with Xerces schemas on input because it initiates an extra and unnecessary validation process.
When you use DocumentVerification, the schema object that is associated with the Document Type must have the following properties set:
- The Document Type property must be XML.
- The DTD or Schema. value must be set to either
- A DTD or Schema file location must be specified ( ).
In the map input card, the following properties must be set.
- The Document Type as described earlier. is set to the object you associated with the
- The Always, OnSuccess, OnFailure, or Well-Formed. setting is set to
Based on these settings, when the map runs, an external parser (document verification program) validates the XML document. If there are no errors, the map completes successfully. If there are errors, the map fails and the error information is written to an audit or trace file (when enabled).
The supported formats are XML with a DTD and XML with an XML Schema.
DocumentVerification settings
Because this setting is at the card level, you can set different options for different input and output cards.
- Schema Validation
- (Default setting) The option is turned off, meaning that only the standard data validation process takes place.
- Always
- Validates an XML document whenever an instance of an object with XML as the Document Type property is found at the card level. This XML document validation takes place in addition to the standard data validation process by using an external validation program.
- OnSuccess
- Validates an XML document when an instance of an object has XML as the Document Type property at the card level and is considered valid during the standard data validation process. This supplemental validation takes place in addition to the standard data validation process by using an external validation program.
- OnFailure
- Validates an XML document only when an instance of an object has XML as the Document Type property at the card level and fails validation during the standard data validation process. This supplemental validation takes place in addition to the standard data validation process by using an external validation program.
- Well Formed
- For Xerces schemas, disables validation of the XML document against the Schema and instead parses it to verify that it is well-formed.
- Ignore Undefined Constructs
- Ignores any elements that are not defined in the Xerces schema or native XML schema. Undefined elements would otherwise fail well-formed parsing with an Element not found error. Ignored elements are not accessible for any type of mapping and are not valid input for the PACKAGE and CPACKAGE functions.