13.3.9. Validating XsltActions


There are several different ways to configure the XsltAction validation. These are listed here with examples:
  1. Disabled (the default)
    This can be explicitly configured to false or omitted to disable validation.
    <property name="validation" value="false"/>
  2. DTD
    <property name="validation" value="true"/>
    <property name="schemaLanguage" value="http://www.w3.org/TR/REC-xml"/>
    Alernatively:
    <property name="validation" value="true"/>
    <property name="schemaLanguage" value=""/>
  3. W3C XML Schema or RELAX NG
    <property name="validation" value="true"/>
    Alternatively:
    <property name="validation" value="true"/>
    <property name="schemaLanguage" value="http://www.w3.org/2001/XMLSchema"/>
    or
    <property name="validation" value="true"/>
    <property name="schemaLanguage" value="http://relaxng.org/ns/structure/1.0"/>
  4. W3C XML Schema or RELAX NG with included schemaFile
    <property name="validation" value="true"/>
    <property name="schemaFile" value="/example.xsd"/>
    or
    <property name="validation" value="true"/>
    <property name="schemaLanguage" value="http://www.w3.org/2001/XMLSchema"/>
    <property name="schemaFile" value="/example.xsd"/>
    Aleternatively:
    <property name="validation" value="true"/>
    <property name="schemaLanguage" value="http://relaxng.org/ns/structure/1.0"/>
    <property name="schemaFile" value="/example.rng"/>
Depending on whether or not validation is enabled there are several different outcomes to an XsltAction:
  1. If the XML is well-formed and valid:
    • The transformation will be performed.
    • The pipeline will continue.
  2. If the XML is malformed:
    • an error will be logged
    • SAXParseException -> ActionProcessingException
    • pipeline stops
  3. If the XML is well-formed but invalid:
    • If validation is not enabled:
      • The transformation may fail.
      • The pipeline will continue.
    • If validation is enabled:
      • an error will be logged
      • SAXParseException -> ActionProcessingException
      • pipeline stops
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.