Camel Spring Boot

XSLT Saxon

Transform XML messages with an XSLT stylesheet using Saxon, which supports XSLT 3.0.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-xslt-saxon-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 14 options, which are listed below.

Name Description Default Type

camel.component.xslt-saxon.allow-template-from-header

Whether a message can replace the stylesheet of the endpoint with the CamelXsltResourceUri header (the URI of another stylesheet) or the CamelXsltStylesheet header (the stylesheet itself, compiled for each message). Enable it only when these headers are set by the route, not taken from incoming messages.

false

Boolean

camel.component.xslt-saxon.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.xslt-saxon.content-cache

Whether the endpoints load and compile their stylesheet once, at startup, and reuse it for every message. When false, the stylesheet is loaded and compiled again for each message, which picks up changes during development. A cached stylesheet can be reloaded at runtime with the JMX operation clearCachedStylesheet.

true

Boolean

camel.component.xslt-saxon.enabled

Whether to enable auto configuration of the xslt-saxon component. This is enabled by default.

Boolean

camel.component.xslt-saxon.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.xslt-saxon.saxon-configuration

A custom Saxon configuration (net.sf.saxon.Configuration) for the endpoints of this component that do not set their own. The secureProcessing option is applied to this configuration, which Saxon uses by reference, so endpoints that share the same configuration must use the same secureProcessing value. The option is a net.sf.saxon.Configuration type.

Configuration

camel.component.xslt-saxon.saxon-configuration-properties

Saxon configuration properties to set on the Saxon configuration of each endpoint, as feature names (the URIs of net.sf.saxon.lib.Feature, such as http://saxon.sf.net/feature/allow-external-functions) mapped to their values. They are applied after secureProcessing and can override it.

Object>

camel.component.xslt-saxon.saxon-extension-functions

Saxon integrated extension functions (net.sf.saxon.lib.ExtensionFunctionDefinition) to register on the Saxon configuration of each endpoint, so that the stylesheets can call them. Refer to the beans in the registry by name, separated by commas.

String

camel.component.xslt-saxon.secure-processing

Whether to enable XML secure processing (javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING) on the Saxon TransformerFactory of each endpoint, and to parse an input that is still to be parsed without access to external resources. With secure processing, Saxon does not allow xsl:result-document and calls of Java methods from the stylesheet (the reflexive extension functions of Saxon-PE and Saxon-EE); the integrated extension functions of saxonExtensionFunctions remain available. With a saxonConfiguration, the feature is set on that configuration, so endpoints that share the same configuration must use the same secureProcessing value.

true

Boolean

camel.component.xslt-saxon.transformer-factory-class

The fully qualified class name of the javax.xml.transform.TransformerFactory implementation to compile the stylesheets with, for the endpoints that do not set their own.

String

camel.component.xslt-saxon.transformer-factory-configuration-strategy

A strategy that configures the javax.xml.transform.TransformerFactory, for example its features or attributes, before the stylesheet is compiled with it. Used by the endpoints that do not set their own. The option is a org.apache.camel.component.xslt.TransformerFactoryConfigurationStrategy type.

TransformerFactoryConfigurationStrategy

camel.component.xslt-saxon.uri-resolver

A custom javax.xml.transform.URIResolver for the endpoints of this component that do not set their own: it loads the stylesheet, its xsl:include and xsl:import references, and the documents of the document() function. When set, uriResolverFactory is not used. The option is a javax.xml.transform.URIResolver type.

URIResolver

camel.component.xslt-saxon.uri-resolver-factory

A custom factory (org.apache.camel.component.xslt.XsltUriResolverFactory) that creates the javax.xml.transform.URIResolver of each endpoint from the resource URI of the endpoint, for example to resolve references relative to the stylesheet. Not used when uriResolver is set. The option is a org.apache.camel.component.xslt.XsltUriResolverFactory type.

XsltUriResolverFactory

camel.component.xslt-saxon.xpath-total-op-limit

The maximum total number of XPath operators in a stylesheet, set as the jdk.xml.xpathTotalOpLimit attribute on the TransformerFactory of each endpoint that does not set its own; a stylesheet that exceeds it fails to compile. 0 or less keeps the setting of the JDK, 10000 by default. A TransformerFactory that does not support this attribute, such as the one of Saxon, ignores it.

10000

Integer