Este contenido no está disponible en el idioma seleccionado.

Chapter 76. XML Tokenize


The XML Tokenize language is a built-in language in camel-xml-jaxp, which is a truly XML-aware tokenizer that can be used with the Split EIP as the conventional Tokenize to efficiently and effectively tokenize XML documents..

XML Tokenize is capable of not only recognizing XML namespaces and hierarchical structures of the document but also more efficiently tokenizing XML documents than the conventional Tokenize language.

Additional dependency

In order to use this component, an additional dependency is required as follows:

<dependency>
    <groupId>org.codehaus.woodstox</groupId>
    <artifactId>woodstox-core-asl</artifactId>
    <version>4.4.1</version>
</dependency>
Copy to Clipboard Toggle word wrap

or

    <dependency>
      <groupId>org.apache.camel.springboot</groupId>
      <artifactId>camel-stax-starter</artifactId>
    </dependency>
Copy to Clipboard Toggle word wrap

76.1. XML Tokenizer Options

The XML Tokenize language supports 4 options, which are listed below.

Expand
NameDefaultJava TypeDescription

headerName

 

String

Name of header to tokenize instead of using the message body.

mode

 

Enum

The extraction mode. The available extraction modes are: i - injecting the contextual namespace bindings into the extracted token (default) w - wrapping the extracted token in its ancestor context u - unwrapping the extracted token to its child content t - extracting the text content of the specified element.

Enum values:

  • i
  • w
  • u
  • t

group

 

Integer

To group N parts together.

trim

 

Boolean

Whether to trim the value to remove leading and trailing whitespaces and line breaks.

76.2. Example

See Split EIP which has examples using the XML Tokenize language.

76.3. Spring Boot Auto-Configuration

When using xtokenize with Spring Boot make sure to use the following Maven dependency to have support for auto configuration:

<dependency>
  <groupId>org.apache.camel.springboot</groupId>
  <artifactId>camel-xml-jaxp-starter</artifactId>
  <version>3.14.5.redhat-00032</version>
  <!-- Use your Camel Spring Boot version -->
</dependency>
Copy to Clipboard Toggle word wrap

The component supports 3 options, which are listed below.

Expand
NameDescriptionDefaultType

camel.language.xtokenize.enabled

Whether to enable auto configuration of the xtokenize language. This is enabled by default.

 

Boolean

camel.language.xtokenize.mode

The extraction mode. The available extraction modes are: i - injecting the contextual namespace bindings into the extracted token (default) w - wrapping the extracted token in its ancestor context u - unwrapping the extracted token to its child content t - extracting the text content of the specified element.

 

String

camel.language.xtokenize.trim

Whether to trim the value to remove leading and trailing whitespaces and line breaks.

true

Boolean

Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat