2009-07-24 73 views
1

我在xsl:stylesheet元素中有一堆名稱空間如何防止名稱空間反映在根子節點中。假設我生成這樣的:阻止將xml名稱空間傳遞給子節點

爲如:

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

感謝, 阿迪亞

+0

如果您不介意我問, 你爲什麼在乎?出於某種原因,這很重要嗎? – 2009-07-24 21:44:52

回答

1

以下內容添加到你的宣言:

exclude-result-prefixes="a b" 
相關問題