Plone 我想用diazo替换属性,但diazo';s<;替换/>;带有属性的语句不工作?

Plone 我想用diazo替换属性,但diazo';s<;替换/>;带有属性的语句不工作?,plone,diazo,Plone,Diazo,我有一些代码如下,但属性'src'不替换 <?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"> <rules cs

我有一些代码如下,但属性'src'不替换

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

    <rules css:if-content="#visual-portal-wrapper">

        <theme href="index.html" />
        <replace css:content="a#portal-logo img" css:theme="h1.logo a img" attributes="src"/>

    </rules>

</rules>

为什么??是一只虫子吗?还是我犯了个错误?有什么建议吗?

尝试使用而不是替换。正如Diazo医生在“替换”部分所说

注意:与处理标记的规则一样,如果 主题和内容节点上都不存在属性, 什么也不会发生。如果要复制属性而不考虑 无论它们是否存在于主题节点上,您都可以使用 相反


如果您在主题中设置了src=“”,您还可以使用

<merge attributes="class" css:theme="h1.logo a img" css:content="a#portal-logo img" />



是的,但这不是正确的方法。因为在我的例子中,“a#portal logo img”和“h1.logo a img”同时存在。为什么不工作?如果您省略attributes=“src”,会发生什么?如果我省略attributes=“src”,将完全工作,替换标记complete,因此我确信该语句是正确的。嗯,您到底想在这里做什么?看起来您正试图用Plone徽标替换主题的徽标。。。你为什么要这么做?我以前在链接上替换了href,但没有替换img src…第一条规则,你是说attributes=“src”而不是“class”
我尝试了上面的
合并
规则,它确实将
src
更新为:
以便工作?如果是这样的话,文档中没有明确描述这一点,这会导致混乱。你是对的。在第一个选项中有一个错误:attributes=“src”。在第二个选项中,尝试在gistboxapp.com上搜索一个名为“diazo”的组,这里有一些有用的提示。
<replace css:content-children="a#portal-logo img" attribute="src">
        <xsl:attribute name="src"><xsl:value-of select="./@src"/></xsl:attribute>
        <xsl:apply-templates />
</replace>