gpt4 book ai didi

plone - Diazo 和xslt "call-template"

转载 作者:行者123 更新时间:2023-12-02 20:18:24 26 4
gpt4 key购买 nike

我正在尝试在我的 Diazo 规则中使用 xslt“call-template”指令,因为我不想“重复我的 self ”。

但是,当我设置 xsl:template 并在规则中使用 xsl:call-template 调用它时,我从 Diazo 调试器中获得了异常

element template only allowed as child of stylesheet

怎么了?我可以使用调用模板吗?如果不是,我怎样才能不在 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>

我发现 diazo 可以在定义为 xsl:stylesheet ( https://github.com/plone/diazo/blob/master/lib/diazo/normalize-rules.xsl ) 的文件中管理它,而不是直接在规则中管理它,但是如何在我的附加包中管理它?

谢谢

最佳答案

如果您仍然遇到此问题,请尝试最新版本的 Diazo 和 plone.app.theming。

我无法使用最新版本(在 Plone 4.3.3 上)重现此问题。对我来说,您的规则示例工作得很好(只要它们位于主[而不是规则文件中)。

关于plone - Diazo 和xslt "call-template",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19196961/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com