Class SaxonPreprocess

All Implemented Interfaces:
Source, SourceLocator, ActiveSource, GroundedValue, Item, MutableNodeInfo, NamespaceResolver, NodeInfo, Sequence, Location, SteppingNode, SiblingCountingNode, Locator

public class SaxonPreprocess extends AnnotationParent
saxon:preprocess is an implementation-defined pre-lexical facet as permitted by XML Schema 1.1. It allows the lexical value as written in the source document to be transformed prior to validation against the constraining facets.

The effect of saxon:preprocess is that the lexical space for a type derived by restriction is no longer constrained to be a subset of the lexical space for the type that it restricts. For example, a type derived from xs:decimal can use <saxon:preprocess action="translate($value, ',', '.')"> to convert the input value "3,14159" to "3.14159", which then validates as an xs:decimal.

More specifically, the saxon:preprocess facet converts the value from the lexical space of a restricted type to the lexical space of its base type. This means that preprocessing may be defined at multiple levels of the type hierarchy; the preprocessing will be performed on the most specific type first.

Note that the pattern facet, if present, applies to the value output by the preprocess facet, not to its input.

  • Constructor Details

    • SaxonPreprocess

      public SaxonPreprocess()
      Creates a new SaxonPreprocess element
  • Method Details

    • prepareAttributes

      protected void prepareAttributes() throws SchemaException
      Validate and process the attributes on this element in the schema document
      Specified by:
      prepareAttributes in class SchemaElement
      Throws:
      SchemaException - if any errors are found in the attributes
    • getAction

      public Assertion getAction()
      Get the Assertion schema component corresponding to the action in this saxon:preprocess element
      Returns:
      the Assertion schema component
    • getReverseAction

      public Assertion getReverseAction()
      Get the Assertion schema component corresponding to the reverse action in this saxon:preprocess element
      Returns:
      the Assertion schema component