1

我在 xsl:stylesheet 元素中有一堆名称空间如何防止名称空间反映在根的子项中。假设我生成类似:

例如:

<xsl:stylesheet xmlns:a="aaa" xmlns:b="bbb">
</xsl:stylesheet>

<result xmlns:a="aaa" xmlns:b="bbb">
 <child1> 
  <gchild11></gchild11>
 </child1>
 <child2> </child2>
 <child3> </child3>
</result>

现在,当我从树中获取特定的孩子时,如何防止命名空间被传递?

也就是说,我应该得到:

 <child3> </child3>

并不是

<child3 xmlns:a="aaa" xmlns:b="bbb"> </child3>

谢谢,阿迪亚

4

1 回答 1

1

在您的声明中添加以下内容:

exclude-result-prefixes="a b"
于 2009-07-24T21:48:00.953 回答