Class SchematronTransmogrifier<T>

All Implemented Interfaces:
Transmogrifier<Source,T>

public class SchematronTransmogrifier<T> extends XsltTransmogrifier<T>
Converts a XML document into a Schematron validation report by applying Schematron rules. The rules to be used are passed in with the XsltTransmogrifier.zap(Source, Object...) call, however, the resulting Xslt Template object is cached for subsequent transformations using this stylesheet.

The following standard Schematron parameters can be passed in as Map parameter:

  • phase : NMTOKEN | "#ALL" (default) Select the phase for validation
  • allow-foreign : "true" | "false" (default) Pass non-Schematron elements and rich markup to the generated stylesheet
  • diagnose : "true" (default) | "false" Add the diagnostics to the assertion test in reports
  • property : "true" (default) | "false" Experimental: Add properties to the assertion test in reports
  • generate-paths : "true" (default) | "false" Generate the @location attribute with XPaths
  • sch.exslt.imports : semi-colon delimited string of filenames for some EXSLT implementations
  • optimize : "visit-no-attributes" Use only when the schema has no attributes as the context nodes
  • generate-fired-rule: "true" (default) | "false" Generate fired-rule elements

Author:
Christian Ohr
  • Constructor Details

    • SchematronTransmogrifier

      public SchematronTransmogrifier()
    • SchematronTransmogrifier

      public SchematronTransmogrifier(Class<T> outputFormat)
    • SchematronTransmogrifier

      public SchematronTransmogrifier(Class<T> outputFormat, Map<String,Object> staticParams)
    • SchematronTransmogrifier

      public SchematronTransmogrifier(XsltTransmogrifier<String> t, Class<T> outputFormat)
    • SchematronTransmogrifier

      public SchematronTransmogrifier(XsltTransmogrifier<String> t, Class<T> outputFormat, Map<String,Object> staticParams)
  • Method Details

    • resourceCacheKey

      protected String resourceCacheKey(Object... params)
      Description copied from class: AbstractCachingXmlProcessor
      Extracts (constructs) resource cache key validator/transmogrifier parameters.

      Per default, the key equals to the resource location.

      Overrides:
      resourceCacheKey in class AbstractCachingXmlProcessor<Templates>
      Parameters:
      params - validator/transmogrifier parameters.
      Returns:
      cache key as a String.
    • createResource

      protected Templates createResource(Object... params)
      Description copied from class: AbstractCachingXmlProcessor
      Creates a ready-to-use resource (e.g. an XML Schema instance) for the given key. Insertion into the cache will happen externally, this method's purpose is only to instantiate the resource to be cached.

      This method does not need to be re-entrant, but its result MUST be thread-safe.

      Overrides:
      createResource in class XsltTransmogrifier<T>
      Parameters:
      params - validator/transmogrifier parameters.
      Returns:
      resource of the configured type.