Returning source document nodes

I'm trying to understand if it is possible to use <xsl:sequence> to
return nodes, specifically elements, from the source document.  Without
getting into the use case behind this, I read both the latest public
working draft and the current working draft as saying that in the
following:
 
<xsl:variable name="foo" select="somepath"/>
 
and 
 
<xsl:variable name="foo">
   <xsl:sequence select="somepath"/>
</xsl:variable>
 
$foo will be assigned equivalent nodes from the source document (in
particular, if the result is some descendant of the root, then I can
apply parent or ancestor axes and get the same results).  If that's the
case, is it further the case (here's the real interesting part) that I
can put the <xsl:sequence> in a template, i.e.,
 
<xsl:variable name="foo">
    <xsl:apply-templates select="." mode="test"/>
</xsl:variable>
 
<xsl:template match=".element." mode="test">
    <xsl:sequence select="somepath"/>
</xsl:template>
 
and, once again, get back an equivalent node?
 
Thank you,
 
Matthew Fuchs

Received on Friday, 12 March 2004 14:09:46 UTC