2013-10-05 49 views
3

我想在我的重氮規則中使用xslt「呼叫模板」指令,因爲我不想「重複我的自我」。重氮和xslt「呼叫模板」

但是,當我建立了xsl:模板,使用XSL稱之爲:調用模板的規則,我獲得重氮調試異常

元素模板只允許作爲樣式

的孩子

這是怎麼回事?我可以使用call-tempalte嗎?如果沒有,我怎麼能不在xslt模板中重複我的自我?

例子:

<?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> 

我發現,在重氮定義爲XSL文件可以管理這個:而在規則直接樣式表(https://github.com/plone/diazo/blob/master/lib/diazo/normalize-rules.xsl),但在我的附加軟件包如何管理呢?

感謝的

+1

向我們展示代碼! – SteveM

+0

Right @SteveM,正確編輯我的問題 – Vito

+0

可能的重複[如何轉換塊的內容從plone插入重氮主題](http://stackoverflow.com/questions/5749561/how-to-transform-b​​lock-of -content從 - Plone的感插入-成重氮基主題) –

回答

0

如果你仍然有這個問題,嘗試最新的重氮和plone.app.theming的版本。

我無法用最新版本(在Plone 4.3.3上)重現此問題。對我來說,你的規則示例工作得很好(只要它們在主[非規則文件]中)。