---
title: "XSLT macro - Cloud"
canonical: "https://support.appfire.com/space/HTML/70616934/XSLT%20macro%20-%20Cloud"
format: markdown
---
> Macro (aura-html)

## Features

- Uses XSLT to transform XML to HTML.
- Provides backward compatibility till XSLT 1.0 version.
- Supports capabilities for including data similar to other scripting macros.
- Supports find and replace for adjusting the resulting output.
- Allows administrators to restrict the usage of JavaScript in the XSLT macro (based on Allow JavaScript in [Configuration](https://appfire.atlassian.net/wiki/x/iIc1B#Configuration-Cloud-HTML_Cld_GlobalConfig) settings). The Confluence page throws a rendering error if this parameter is not enabled, and JavaScript is inserted while using the macro.

## Parameters

|  |  |
| --- | --- |
| ![HTML for Confluence XSLT macro editor with location and output fields](media://cd977b23-a02d-4d95-995c-ce33f5af8a0e) | ![HTML for Confluence XSLT macro output preview on a Confluence page](media://0febed77-b234-4a5f-83f4-98475ef7cdfc) |

| **Macro editor label** | **Default** | **Description** |
| --- | --- | --- |
| <u>***Data source***</u> |
| *Data source* |  | Specify the source of the XML content to be rendered. The options available are:<br>- *XML embed code*: Enter XML code to display content. If this option is selected, a code block section appears where you can enter customized XML code to be displayed.
  - To add XSL code click “<span style="color: #0747a6">Click here to add/edit xsl source</span>” and enter XSL code.
- *URL*: If this option is selected, a *URL* parameter is displayed. Enter the URL of the required source from which the XML content is to be displayed on the page.
  - To add XSL URL click “<span style="color: #0747a6">Click here to add/edit xsl source</span>” and enter the URL of the XSL content.
- *Profile*: Select a profile to access the required source for XML content. Refer to [this link](/wiki/pages/resumedraft.action?draftId=70617024#HTMLmacro-Cloud-HTML_Cld_Profiles) to know more about profiles.
  - To add XSL profile click “<span style="color: #0747a6">Click here to add/edit xsl source</span>” and enter the profile for the XSL content.
- *Attachment*: Specify the attachment whose XML content is to be rendered. By default, *Space* and *Page* show the current space and page, respectively.
  - *Space*: Data is read from an attachment to the page name provided in the space indicated.
  - *Page*: Data is read from an attachment to the page name provided.
  - *Attachment*: Data is read from an attachment to the current page.
  - To add XSL attachment click “<span style="color: #0747a6">Click here to add/edit xsl source</span>” and select the XSL attachment similar way. |
| <u>***Layout***</u> |
| *Height of iframe (in px)* |  | Enter the minimum height (in px or em) to be used for the rendered content.<br>If you do not specify, the height is auto-rendered according to the rendered content.  
If you specify the height, the rendered content fits within the specified height. If the content exceeds the specified height, a scroll bar is displayed that lets you scroll through the content.<br>Example: *500px* |
| <u>***Settings***</u> |
| *Format* | *html* | Specify how the output is treated. The options are as follows:<br>- *html* - transformed output is standard HTML
- *xhtml* - transformed output is treated as XHTML and rendered with the Confluence XHTML renderer
- *wiki* - transformed output is treated as wiki markup and rendered with the Confluence wiki renderer |
| *Find regex patterns* |  | Enter a comma-separated list of regex patterns to repair and modify XML prior to processing by the XSLT processor with find and replace logic. Example: *(google\.dtd)* |
| *Replacement strings* |  | Enter a comma-separated list corresponding to find patterns via index position in the list. Example: *http://www.google.com/$1* |
| *Error Level* | *NONE* | Specify the level at which the data processing fails. The options are:<br>- *NONE* - No action is to be taken.
- *WARNING* - Display a warning about the data process; processing does not stop.
- *ERROR* - Display an error, and further processing is halted.
- *FATAL* - Stops any further data processing. |
| *Timeout in milliseconds* |  | Enter time in milliseconds such that URL connections do not timeout before getting data. Use this to increase time needed for slow connections. Note that if a zero is given the connection may wait infinitely. |
| *File encoding* | system default | Specify the encoding for an external file, if different from the system default handling. Example: *UTF-8*. |

## Usage

| Download a copy of the `cdcatalog.xsl` from [https://www.w3schools.com/xml/cdcatalog.xsl](https://www.w3schools.com/xml/cdcatalog.xsl) and attach it to your page.<br>```
{xslt:style=^cdcatalog.xsl}
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
</cd>
<cd>
<title>Maggie May</title>
<artist>Rod Stewart</artist>
<country>UK</country>
</cd>
</catalog>
{xslt}

```<br>```
{xslt:source=^cdcatalog.xml|style=#http://www.w3schools.com/xsl/cdcatalog.xsl}
{xslt}

```<br>```
{xslt:source=xslt - basic^cdcatalog.xml|style=#http://www.w3schools.com/xsl/cdcatalog.xsl}
{xslt}

```<br>## > Macro (anchor)

Passing parameters to the XSLT engine<br>Parameters that are not interpreted by the XSLT macro are passed through to XSLT. You must use wiki macro syntax to take advantage of this.<br>Consider the following example provided by Johan Nagels:<br>```
{xslt:output=wiki|source=Home^snippets.xml|winnersOnly=lala}
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="winnersOnly">no</xsl:param>
<xsl:output method="html"/>
<xsl:template match="/">
The value of winnersOnly is "<xsl:value-of select="$winnersOnly"/>"
</xsl:template>
</xsl:stylesheet>{xslt}

```<br>The output is: `The value of winnersOnly is "lala"`.<br>If you omit the parameter, then the output is: `The value of winnersOnly is "no"`. |
| --- |