[[PageOutline(2-5,Contents,pullout)]]
= XSL-Transformation Macro
== Description
The XsltMacro allows you to embed the result of an XSL-transformation in a page. It takes two parameters, a stylesheet and a document to transform. These can be an attachment on any wiki-page or ticket, any page from the htdocs area, any file in the repository, or any url. These options are similar to those for Trac's native [t:wiki:WikiMacros#AvailableMacros ImageMacro].
For more details see the documentation in the macro.
With this macro call:
{{{
[[Xslt(format.xsl, info.xml)]]
}}}
The following table is produced:
{{{#!html
Name |
Address |
Email |
John Smith |
42 Easy St |
johns@cool.com |
Mary Francis |
1 Heavenly Way |
maryf@hot.com |
}}}
Here's how you would tell it to use an iframe:
{{{
[[Xslt(format.xsl, info.xml, use_iframe, if_height=500)]]
}}}
For the full docs see the WikiMacros page after installing this macro.
The macro can either be installed as a simple macro or as a plugin; the ''use_iframe'' and ''use_object'' options (see below) only work when installed as a plugin.
This macro requires that [http://xmlsoft.org/ libxml2], [http://xmlsoft.org/ libxslt], and their python bindings are installed.
=== IFrames/Objects
Because a macro's output is embedded in the html of the wiki page, the xsl-stylesheet must not produce a full html page. As an alternative, you can pass the ''use_iframe'' or ''use_object'' option to the macro; this will cause the macro put an