---
title: c XSLT
description: Available connectors
documentId: ipaas-xslt
locale: en-US
---

The [**XSLT**](https://camel.apache.org/components/4.10.x/xslt-component.html) component is used to transform XML documents using an XSLT stylesheet, allowing data to be converted to different formats or structures.

**URI Syntax**: `xslt:resourceUri`

## Main fields

*Path parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|------------------|------------|----------|
| `resourceUri` (producer)| (required) Path to the template. The following is supported by the default URIResolver. You can prefix with: classpath, file, http, ref or bean. classpath, file and http load the resource using these protocols (classpath is the default). | — | String |

## Example

<Steps>
<Step>
The flow starts with a POST request.
</Step>
<Step>
The `toD` EIP indicates that the flow should route execution to a dynamic URI.
</Step>
<Step>
The route then makes a GET request, obtaining an XML response.
</Step>
<Step>
Then, transforms the XML response to JSON using an XSLT file: [`response_to_json.xslt`](#xslt-file).
</Step>
</Steps>

```yaml
- from:
    uri: "rest:post:/source-xslt"
    steps:
      - toD:
          uri: "https://httpbin.org/xml"
          parameters:
            bridgeEndpoint: true
            httpMethod: GET
      - to:
          uri: "xslt:classpath:response_to_json.xslt"
```

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/component_xslt_758e077450.png)

### XSLT file

```xslt
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <!-- Template para correspondência com o elemento 'slideshow' -->
  <xsl:template match="slideshow">
    <html>
      <body>
        <h1><xsl:value-of select="@title"/></h1>
        
        <!-- Para cada slide dentro do slideshow -->
        <xsl:apply-templates select="slide"/>
      </body>
    </html>
  </xsl:template>
  
  <!-- Template para correspondência com o elemento 'slide' -->
  <xsl:template match="slide">
    <div>
      <h2><xsl:value-of select="title"/></h2>
    </div>
  </xsl:template>
  
</xsl:stylesheet>
```
