Developer manual

Custom XSLT call from layout.xml

Custom XSLT call requires the custom tag in layout.xml:

<layout mode="advanced javascript">
...
<if id="pageid" value="custom-xslt-call">
<custom-xslt-call/>
</if>
...
</layout>

And a matching template in custom.xslt:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Client Custom XSLT -->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:exsl="http://exslt.org/common"
version="1.0"
exclude-result-prefixes="xsi exsl">
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- Custom XSLT Call Test -->
<xsl:template match="custom-xslt-call">
<p>Call Successful</p>
</xsl:template>

</xsl:stylesheet>

Variables/Scope

The following variables/scope are available:

  • $pageoutput - full input xml of all content, navigation, styles and metadata associated with the current page call prior to any xslt alterations
  • $layout - unproccessed layout.xml file
  • / - processed layout.xml file

Test Result: