3

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

SteveM
  • 6,058
  • 1
  • 16
  • 20
Vito
  • 1,201
  • 1
  • 10
  • 16
  • Right @SteveM , juste edited my question – Vito Oct 07 '13 at 07:29
  • possible duplicate of [How to transform block of content from plone being inserted into diazo theme](http://stackoverflow.com/questions/5749561/how-to-transform-block-of-content-from-plone-being-inserted-into-diazo-theme) – Paul Sweatte Jun 30 '14 at 21:26

1 Answers1

0

If you still have this issue, try the most recent versions of Diazo and plone.app.theming.

I cannot reproduce this issue with the latest versions (on Plone 4.3.3). For me, your rules example works just fine (as long as they are in the main [not rules file).

Asko Soukka
  • 1,763
  • 11
  • 8