0

我正在尝试使用复制当前节点下方存在的所有节点,<xsl:copy-of select="." />并且它也在复制根节点中存在的命名空间。如何避免这种情况?


你可以使用timthumb插件。

http://code.google.com/p/timthumb/
4

1 回答 1

1

If the namespaces are unwanted, then in XSLT 2.0 you can use <xsl:copy-of select="." copy-namespaces="no"/>. Note however that this will only get rid of unused namespace nodes; it will not change the namespace of any element or attribute. If you want the elements or attributes in your copy to be in a different namespace from the original, then you need to do a recursive shallow copy, along the lines of:

<xsl:template match="*">
  <xsl:element name="{local-name()}" namespace="new-namespace">
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>
于 2013-10-15T09:39:14.363 回答