Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 82. XSLT


Transforms XML payload using an XSLT template.

82.1. What’s inside

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

82.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-xslt</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

82.3. Additional Camel Quarkus configuration

To optimize XSLT processing, the extension needs to know the locations of the XSLT templates at build time. The XSLT source URIs have to be passed via the quarkus.camel.xslt.sources property. Multiple URIs can be separated by comma.

quarkus.camel.xslt.sources = transform.xsl, classpath:path/to/my/file.xsl
Copy to Clipboard Toggle word wrap

Scheme-less URIs are interpreted as classpath: URIs.

Only classpath: URIs are supported on Quarkus native mode. file:, http: and other kinds of URIs can be used on JVM mode only.

<xsl:include> and <xsl:messaging> XSLT elements are also supported in JVM mode only right now.

If aggregate DSL is used, XsltSaxonAggregationStrategy has to be used such as

from("file:src/test/resources?noop=true&sortBy=file:name&antInclude=*.xml")
   .routeId("aggregate").noAutoStartup()
   .aggregate(new XsltSaxonAggregationStrategy("xslt/aggregate.xsl"))
   .constant(true)
   .completionFromBatchConsumer()
   .log("after aggregate body: ${body}")
   .to("mock:transformed");
Copy to Clipboard Toggle word wrap

Also, it’s only supported on JVM mode.

82.3.1. Configuration

TransformerFactory features can be configured using following property:

quarkus.camel.xslt.features."http\://javax.xml.XMLConstants/feature/secure-processing"=false
Copy to Clipboard Toggle word wrap

82.3.2. Extension functions support

Xalan’s extension functions do work properly only when:

  1. Secure-processing is disabled
  2. Functions are defined in a separate jar
  3. Functions are augmented during native build phase. For example, they can be registered for reflection:
@RegisterForReflection(targets = { my.Functions.class })
public class FunctionsConfiguration {
}
Copy to Clipboard Toggle word wrap
Note

The content of the XSLT source URIs is parsed and compiled into Java classes at build time. These Java classes are the only source of XSLT information at runtime. The XSLT source files may not be included in the application archive at all.

Expand
Configuration propertyTypeDefault

lock quarkus.camel.xslt.sources

A comma separated list of templates to compile.

string

 

lock quarkus.camel.xslt.package-name

The package name for the generated classes.

string

org.apache.camel.quarkus.component.xslt.generated

lock quarkus.camel.xslt.features

TransformerFactory features.

Map<String,Boolean>

 

lock Configuration property fixed at build time. All other configuration properties are overridable at runtime.

Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat