I'm trying to use the xslt "call-template" directive in my diazo rules, cause I don't want "repeat my self".
But, when I set-up the xsl:template and call it with xsl:call-template in the rules I obtain an exception from the diazo debugger
element template only allowed as child of stylesheet
What's the matter? Can I use the call-tempalte? And if not, how I can don't repeat my self in the xslt templating?
Example:
<?xml version="1.0" encoding="UTF-8"?>
<rules
xmlns="http://namespaces.plone.org/diazo"
xmlns:css="http://namespaces.plone.org/diazo/css"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- indent and strip space for pretty output -->
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<theme href="index.html" />
<after css:theme-children="body">
<xsl:call-template name="hello"></xsl:call-template>
</after>
<xsl:template name="hello">
<xsl:element name="div">
Hello!
</xsl:element>
</xsl:template>
</rules>
I found that diazo could be manage this in a file defined as xsl:stylesheet (https://github.com/plone/diazo/blob/master/lib/diazo/normalize-rules.xsl) rather directly in the rules, but how manage this in my add-on package?
Thank's