Xslt mediator allows specifying special parameters which are used for the transformation process:
<?XsltMediator inputitemname="*package name*" outputitemname="*package name*" extensionsTbbId="*tcm:223-123123-2048*"?>
The output methods defined are:
- XHTML
- XML
- HTML
- Text
For Example:
<xsl:stylesheet>
<xsl:output method="xhtml" /> (or xml, html, text)
</xsl:stylesheet>
Available (auto-populated) parameters for use in transformation:
- TEMPLATE_URI
- tcm:Page
- tcm:ComponentTemplate
- tcm:Publication
- tcm:ResolvedItem
- tcm:ResolvedTemplate
- tcm:XsltTemplate
For Example:
<xsl:param name="TEMPLATE_URI" />
<xsl:param name="tcm:Page" />
<xsl:param name="tcm:ComponentTemplate" />
<xsl:param name="tcm:Publication" />
<xsl:param name="tcm:ResolvedItem" />
<xsl:param name="tcm:ResolvedTemplate" />
<xsl:param name="tcm:XsltTemplate" />
Additionally its possible to read package variables:
<xsl:param name="*Package Name*" />
(Supports plain, html, xml package items) or
<xsl:param name="${Indirect Name}" />
This allows specifying a package variable which in turn specifies the variable name to look up the actual value from.
-
Default XsltTemplateHelper
-
String GetFormattedDate(string inputDate, string dateFormat)
-
XmlDocument GetListItems(String orgItemId)
-
XmlDocument GetMultimediaInfo(String id)
-
Adding IFunctionSource from Package.FunctionSources Configured through Tridion.ContentManager.config as per SDL Portal: Custom Functions
-
Add IFunctionSource exported through ExtensionTbbId (Defined as xslt processing instruction)
Namespace can be configured by implementing the Tridion.ContentManager.Templating.Xslt.XsltExtensionAttribute on the extension class.
[XsltExtensionAttribute(Namespace = "http://www.company.com/tridion/xslt/functionsource")]
public class Xslt : IFunctionSource
{
....
Note that when no namespace is specified, the default namespace is: http://www.sdltridion.com/ContentManager/FunctionSource/ + typename