Edit online

Validation Scenarios

A complex XML document is split in smaller interrelated modules. These modules do not make much sense individually and cannot be validated in isolation due to interdependencies with other modules. Oxygen XML Editor validates the main module of the document when an imported module is checked for errors.

A typical example is the chunking of a DocBook XSL stylesheet that has chunk.xsl as the main module and param.xsl, chunk-common.xsl, and chunk-code.xsl as imported modules. param.xsl only defines XSLT parameters. The module chunk-common.xsl defines an XSLT template with the name chunk. Chunk-code.xsl calls this template. The parameters defined in param.xsl are used in the other modules without being redefined.

Validating chunk-code.xsl as an individual XSLT stylesheet generates misleading errors regarding parameters and templates that are used but undefined. These errors are only caused by ignoring the context in which this module is used in real XSLT transformations and validations. To validate such a module, define a validation scenario to set the main module of the stylesheet and the validation engine used to find the errors. Usually this engine applies the transformation during the validation process to detect the errors that the transformation generates.

You can validate a stylesheet with several engines to make sure that you can use it in various environments and have the same results. For example, an XSLT stylesheet may be applied with Saxon 12 or Saxon 6.5 engines in different production systems.

Other examples of documents that can benefit from a validation scenario include:
  • A complex XQuery file with a main module that imports modules developed independently but validated in the context of the main module of the query. In an XQuery validation scenario, the default validator of Oxygen XML Editor (Saxon 12) or any connection to a database that supports validation (eXist XML Database, MarkLogic version 5 or newer) can be set as a validation engine.
  • An XML document where the main file includes smaller fragment files using XML entity references.
    Note: If a main file is associated with the current file, the validation scenarios defined in the main file, along with any Schematron schema defined in the default scenarios for that particular framework, are used for the validation. These take precedence over other types of validation units defined in the default scenarios for the particular framework. For more information on main files, see Contextual Project Operations Using 'Main Files' Support or Modular Contextual XML Editing Using 'Main Files' Support.
Tip: Status information generated by certain operations (such as validation) are fed into the Information view. This could be helpful for troubleshooting problems encountered during such operations. To open this view, select Window > Show View > Information.