我试图在我的重氮规则中使用xslt的“调用模板”指令,因为我不想“重复我自己”。
但是,当我在规则中设置xsl:template并使用xsl:调用它时,我会从diazo调试器获得一个异常。
元素模板仅允许作为样式表的子元素。
你怎么了?我能用电话吗?如果不是,我如何才能在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)的文件中管理,但是如何在我的外接程序包中管理呢?
谢谢
发布于 2014-08-09 05:30:09
如果仍然存在此问题,请尝试最新版本的Diazo和plone.app.theming。
我不能用最新版本(在Plone 4.3.3上)复制这个问题。对我来说,您的规则示例工作得很好(只要它们位于主(而不是规则文件)中)。
https://stackoverflow.com/questions/19196961
复制相似问题