Skip to main content
Skip table of contents

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

Operation

Defines the operation executed by the adapter

Possible values: Validate: Validate XML document

Parameters

Adapter

Main adapter class (do not change!)

Possible values: de.softproject.integration.adapter. xmlvalidator.XMLValidator: Main class (Default)

SchemaUrl

Path to the schema definition (XML schema or Relax NG)

Possible values: Any xstore:// URL (e.g. xstore://Project/Folder/Schema.xsd)

Verbose

Specification, whether the result document should contain detailed information on the validation error

Possible values:

  • true: The result document contains detailed information on the validation error (default)

  • false: The adapter stops validation after the first error and doesn't output any information on the error

xsdVersion

XSD version to be used to validate XML documentsl

Possible values:

  • 1.0: XSD version 1.0 is used

  • 1.1: XSD version 1.1 is used

Status values

-1 (error)

An error occurred during the adapter's execution. For more detailed information see the server log.

1 (successful)

The XML document is valid according to the specified schema; The function adapter has output the verified input XML document unmodified.

2

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.:

HTML/XML
<?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>

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.