Hi,

When I trigger this stylesheet

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
        xmlns:javascript
="javascript:code"
        xmlns:xsl
="http://www.w3.org/1999/XSL/Transform"
        xmlns:xs
="http://www.w3.org/2001/XMLSchema"
        xmlns:xfn
="http://www.w3.org/2003/11/xpath-functions"
        xmlns:saxon="http://saxon.sf.net/" extension-element-prefixes="saxon"
        exclude-result-prefixes
="xsl xs xfn saxon javascript">

        <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

        <xsl:variable name="res" select="document('src/resource/resource.xml')/*"/>
        <xsl:variable name="src">
                <section>
                        <section>
                                <item/>
                        </section>
                </section>
        </xsl:variable>
        <xsl:variable name="a" saxon:assignable="yes"/>
        <xsl:variable name="b" saxon:assignable="yes">
                <xsl:copy-of select="$src"/>
        </xsl:variable>
        
        
<xsl:template match="/">
                <saxon:assign name="a">
                        <xsl:copy-of select="$src"/>
                </saxon:assign>
                <xsl:message>A: <xsl:value-of select="concat(name($a), '/', name($a/*[1]), '/', name($a/*[1]/*[1]), '/', name($a/*[1]/*[1]/*[1]))"/></xsl:message>
                <xsl:message>B: <xsl:value-of select="concat(name($b), '/', name($b/*[1]), '/', name($b/*[1]/*[1]), '/', name($b/*[1]/*[1]/*[1]))"/></xsl:message>
        </xsl:template>
        
</xsl:stylesheet>

with this XML source,

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="test.xslt"?>
<go/>

I get this

A: section/section/item/
B: /section/section/item

Which surprises me since I was expecting the same result.
Does anybody know what is happening here ?

From what I can see, give a node set to an assignable at declaration time and saxon:assign it the same node set later and the referencing will have changed (by 1 indirection level, apparently eaten by saxon:assign).

Thank you
Andre