0

使用 Diazo,我在主题和内容以及一些依赖于内容 id 的 JS 之间存在 id 冲突。如何将主题中的元素 id 属性从一个值更改为另一个值?

4

2 回答 2

1

更改主题中的值的最简单方法是在编辑器中打开它并编辑 html ;) 如果您在更改内容中的 id 以匹配主题中的标记之后,那么您可以使用替换内容规则,请参阅:http ://diazo.org/advanced.html#modifying-the-content-on-the-fly

(替换内容规则基本上替换了 Diazo 中的 xsl:template。后者仍然有效,但您现在应该正常使用替换内容。)

于 2011-12-15T15:19:48.073 回答
0

这应该有效:

<replace css:theme="{theme-selector}" css:content="{content-selector}" />
<xsl:template match="{theme-selector}">
  <xsl:attribute name="{attr-name}">
    <xsl:value-of select="{attr-value}" />
  </xsl:attribute>
</xsl:template>

更多信息:

于 2011-12-14T22:13:29.843 回答