The Zip XSD Validation filter is used to validate XML documents against an XML Schema Definition Language (XSD) schema. The filter returns the original XML message if the message is valid and includes the option to route to the error connector, to continue processing the message, or to return an XML document with full error information if the message is invalid. There are three levels of validation error (warn, error and fatal error) which you can set as the minimum validation failure level. During message validation, the filter counts the number of errors which have occurred, both in total and for each level of error, and stores these values in the message properties.

The XML Schema Definition Language (XSD) is an XML language for describing and constraining the content of XML documents.

This filter validates the XSD that you supply to make sure that it has no errors.

Refer to XML Schema for details.

Configuration Properties

Property

Description

Maximum Concurrency

The maximum level of concurrency for this filter. A setting of 0 (zero) means unlimited. Limiting the level of concurrency limits memory usage. Refer to Maximum Concurrency for details.

Zip File

The Zip file that contains the XSD file that you would like to use. The zip should also contain all other relevant XSD files that are included using <xs:include> or <xs:import> tags.

If your Zip file is using folder paths or XSD filenames that contain non-ASCII filenames, you should ensure that your zip file has been created with UTF-8 encoding.

XSD Path

The path (in the Zip file) to the XSD file that you would like to use. This path should not be URL-encoded.

If your XSD file is referencing other XSD files using <xs:include> or <xs:import> tags, and those XSD filenames or the folder paths to them contain non-ASCII filenames, you should ensure that you URL-encode the paths and/or filenames.

On Validation Failure

The action to be performed if validation fails:

  • Send to error connector (default) - the message is sent to the error connector.
  • Continue processing on route - the message is routed to the next filter or output communication point to continue processing the message.
  • Send error report to route - the body of the message is replaced by an XML document containing full error information and the original message and the message is routed to the next filter or output communication point.

    The original message will appear Base64 encoded so that it is preserved no matter what its original encoding was.

    A sample error report as output by Send error report to route is as follows:

    <?xml version="1.0" ?> 
    <XSDValidationReport> 
       <Errors> 
          <Error>TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.</Error> 
          <Error>cvc-elt.1: Cannot find the declaration of element 'HeadCount'. </Error> 
          <Error>TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.</Error> 
       </Errors> 
       <FatalErrors> 
          <FatalError>The element type "Name" must be terminated by the matching end-tag "</Name>". </FatalError> 
       </FatalErrors> 
       <OriginalMessage> PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz3JnLzIwHNkIiBtb29kQ29kdWVzdC12 MS0wIi8+DQoJPHF1ZXJ5RXZc2VtYW50 aWNzVGV4dD5QZXJzb24uRGF0bWJlcj4NCgk8L3F1ZXJ5RXZlbnQ+DQo8L3ZlcmlmeU5IU051bWJlclJlcXVlc3QtdjEt MD4NCg==
       </OriginalMessage> 
    </XSDValidationReport>
    

Minimum Validation Failure Level

Options: Warn, Error, Fatal Error. Default: Fatal Error
The minimum level that the filter decides the message is invalid.

Halt Checking On Error

Whether to halt checking on error:

  • Enabled (default) - the filter stops checking as soon as a minimum failure level error occurs.

    This option does not apply to fatal errors; validation checking stops on the first fatal error even if this property is disabled.

  • Disabled - the filter continues validation checking to the end of the message, even if a minimum failure level error occurs, and decides the message validation failure after the checking is completed.

Validation Options

XSD validation checking options. All options set to false by default. If a particular checking option needs to be turned on then select the option and set its value to True. The checking options are:

  • Full schema constraint checking - enables full schema grammar constraint checking, including any checking which may be time-consuming or memory intensive. Particle unique attribution constraint checking and particle derivation restriction checking are controlled by this option. This option checks the schema grammar itself for additional errors that are time-consuming or memory intensive. It does not affect the level of checking performed on document instances that use schema grammars.
  • Warn on re-declared duplicate attribute - reports a warning for duplicate attribute declaration.
  • Warn on re-declared duplicate entity - reports a warning for duplicate entity declaration.
  • Allow Java encoding names in XMLDecl and TextDecl line - the encoding of the file may be specified as a Java encoding name as well as the standard ISO encoding name. Be aware that other XML parsers may not be able to use Java encoding names. If False, an error will be generated if Java encoding names are used.

Published Properties

Published properties for the Zip XSD Validation filter are:

  • WarnCount - the number of warnings which occurred during validation checking.
  • ErrorCount - the number of errors which occurred during validation checking.
  • FatalErrorCount - the number of fatal errors which occurred during validation checking. FatalErrorCount is either 0 or 1, because the filter stops validation checking on the first fatal error.
  • TotalErrorCount - the total number of errors which occurred during validation checking, in other words it is the sum of property values of WarnCount, ErrorCount and FatalErrorCount.