Hi All!

Recently I have switched to Xalan 2.7.0 (I needed the xalan:evaluate behaviour).

But there is something strange with this instruction:

<xsl:copy-of select="namespace::*" />

I have a root node <root /> and I want to extend its namespaces.
I did it this way:

<!-- override root node -->
<lns:root
        xmlns:new_ns_1="address1"
        xmlns:new_ns_2="address2"
>
        <xsl:copy-of select="namespace::*" />
        <xsl:copy-of select="@*" />

        <!-- contiune with child nodes -->
        <xsl:apply-templates select="node()" />

</lns:root>

Given input:

<lns:root xmlns:lns="qwqw" xmlns:ns1="sdfsf" param1="aaa" param2="122">
<lns:a />
<lns:b />
</lns:root>

the result is:

<lns:root xmlns:new_ns_1="address1" xmlns:new_ns_2="address2"
param1="aaa" param2="122">
<lns:a xmlns:lns="qwqw" xmlns:ns1="sdfsf"  />
<lns:b xmlns:lns="qwqw" xmlns:ns1="sdfsf" />
</lns:root>

expected:

<lns:root xmlns:new_ns_1="address1" xmlns:new_ns_2="address2"
xmlns:lns="qwqw" xmlns:ns1="sdfsf" param1="aaa" param2="122">
<lns:a />
<lns:b />
</lns:root>

root's existing namespaces are copied to child nodes

previously I was using default XSLT shipped with Sun JDK - it was
working as expected.
new namespaces were appended to (and only to) <root /> element.

any ideas what is going on?

best regards
Łukasz

Reply via email to