...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
1 | exclude | On this page |
---|
type | flat |
---|
separator |
---|
|
|
...
Description
Excerpt |
---|
Uses XSLT to transform XML to HTML, XHTML, or wiki markup |
Parameters
Table plus |
---|
Parameter | Default | Macro Browser Label | Description |
---|
output | html | Transformed output format | Determines how the transformed output is to be treated. - 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
|
---|
source | macro body | Location of XML code | Required if style (XSLT code) is in macro body. - #filename - Data is read from the file located in confluence home directory/script/filename. Subdirectories can be specified.
- global page template name - Data is read from a global page template. Special note: How to deal with templates on Confluence 4.3 and later.
- space:page template name - Data is read from a space template.
- ^attachment - Data is read from an attachment to the current page.
- page^attachment - Data is read from an attachment to the page name provided.
- space:page^attachment - Data is read from an attachment to the page name provided in the space indicated.
|
---|
style | required or macro body if source is specified | Location of XSLT code | Required if source XML is in the macro body, otherwise defaults to the macro body - #filename - Data is read from the file located in confluence home directory/script/filename. Subdirectories can be specified.
- global page template name - Data is read from a global page template. Special note: How to deal with templates on Confluence 4.3 and later.
- space:page template name - Data is read from a space template.
- ^attachment - Data is read from an attachment to the current page.
- page^attachment - Data is read from an attachment to the page name provided.
- space:page^attachment - Data is read from an attachment to the page name provided in the space indicated.
|
---|
find | | Find regex patterns | Comma separated list of regex patterns to use to repairing and modifying XML prior to processing by the XSLT processor with find and replace logic. HTML-68 has a bit more on this. |
---|
replace | | Replacement strings | Comma separated list corresponding to find patterns via index position in list. Single quote entries containing a comma. - Example: http://www.google.com/$1
|
---|
head | false | Include head section HTML | Only in affect if clean=true. The head tag is always removed. However, setting this to true will retain all the other tags from the head section and treat them as regular body content. This is useful for retaining style information in particular. |
---|
showErrors | false | Show error message panel | XSLT transformer generated warning and errors will appear in a panel even if the transform is not terminated with an error. Terminating errors automatically generate an error panel. |
---|
encoding | system default | File encoding | Encoding for an external file if different from the system default handling. Example: UTF-8. |
---|
user | | URL user | User name for URL access via basic authentication. |
---|
password | | URL user password | User password for URL access via basic authentication. |
---|
timeout | | Timeout in milliseconds | URL connections may timeout before getting data. Use this to increase time needed for slow connections. Be careful using 0 for an infinite wait. |
---|
<transformer parameters> | | | Only available when specifying xslt macro via wiki markup. See this example. |
---|
|
Usage
No Format |
---|
{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}
|
...
Anchor |
---|
| transformerParameters |
---|
| transformerParameters |
---|
|
Passing parameters to the XSLT engine
- Parameters not interpreted by the xslt macro are passed through to xslt. You must use wiki macro syntax to take advantage of this.
The following example provided by Johan Nagels
No Format |
---|
{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}
|
The output is: The value of winnersOnly is "lala"
If you omit the parameter, then the output is: The value of winnersOnly is "no"
Gallery