XML Validation
The adapter validates an input XML document against an XML schema or a Relax NG schema. If the validated XML document is valid, the adapter outputs the document without modifications; If the document is invalid, an XML document with the corresponding error message will be output.
Note:
If you receive the error message DOCTYPE is disallowed when the feature "
http://apache.org/xml/features/disallow-doctype-decl" set to true.: org.xml.sax.SAXParseException; systemId: locationOfSchema.xsd
in the output of the adapter and in the Server Log, the XSD file found in the systemId
element contains a DOCTYPE declaration.
However, DOCTYPE declarations are disabled for security reasons to protect against XML entity attacks.
Properties
| Defines the operation executed by the adapter Possible values: |
Parameters
| Main adapter class (do not change!) Possible values: de.softproject.integration.adapter. xmlvalidator.XMLValidator: Main class (Default) |
| Path to the schema definition (XML schema or Relax NG) Possible values: Any |
| Specification, whether the result document should contain detailed information on the validation error Possible values:
|
| XSD version to be used to validate XML documentsl Possible values:
|
Status values
| An error occurred during the adapter's execution. For more detailed information see the server log. |
| The XML document is valid according to the specified schema; The function adapter has output the verified input XML document unmodified. |
| The XML document is invalid according to the specified schema; The function adapter has output an error message (see Output). |
Output
The function adapter outputs a UTF-8-encoded XML document. If the validation was successful, the adapter will output the input document without modifications. If the document is invalid, an XML document with the corresponding error message will be output. An XML element <Error/>
containing the detailed error description will be created for each error, e.g.:
<?xml version="1.0" encoding="UTF-8"?>
<ValidationErrors>
<Error>cvc-maxLength-valid: Value 'abc123' with length = '6' is not facet-valid with respect to maxLength '5' for type 'id'.</Error>
<Error>cvc-type.3.1.3: The value 'abc123' of element 'Id' is not valid.</Error>
</ValidationErrors>