Subject: Re: [xsl] Trying to understand root-less or document-node-less nodes From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Tue, 18 Sep 2007 08:39:45 +0200 |
<xsl:variable name="y2">
<xsl:copy-of select=$x/x/b"/>
</xsl:variable>
<xsl:variable name="y3" as="element()"> <xsl:sequence select=$x/x/b"/> <foo/> <xsl:sequence select=$x/x/c"/> </xsl:variable>
is a sequence of 5 elements two bs, a foo and a c, but note that teh b's
and c's are siblinngs of each other (and all are siblings of $x/x/a) but that
<foo/> is a new parentless element not a sibling of anything.
xsl:function (and xsl:template, xsl:if and several other instructions) work like xsl:variable with as="item()". That is, their content generates a sequence which is returned as the value of the instruction. xsl:variable (and xsl:param) without an as attribute generate a sequence in the same way, but then as an additional step generate an implict document node and _copy_ the generated sequence as children of that node (which implies generating text nodes corresponding to any atomic values in the sequence)
Cheers, -- Abel Braaksma
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Trying to understand root, David Carlisle | Thread | Re: [xsl] Trying to understand root, David Carlisle |
[xsl] [Announce:] Version 2008 of t, ANNOUNCE | Date | Re: [xsl] Trying to understand root, David Carlisle |
Month |