Andrew Welch wrote:
What you're describing is the same as typing the variable as="element()" eg:
<xsl:variable name="root" as="element()+">
<test1 />
<test2 />
</xsl:variable>
By adding as="element()+" the variable goes from a root with two child
elements that are siblings (eg to access <test1/> use $root/test1) to
a sequence of elements with no root and that aren't siblings (to
access <test1/> use $root[1])
Hi David, thanks for your response. Surely that adds to clarity (and
iirc, Michael Kay often tried to emphasize the use of the 'as' clause to
prevent the document node from being created). But root() never seems to
fail: in your example, that means that the result is a sequence of two
elements with each having a root equal to self::node()? And both, I
guess, not being siblings from one another?
Cheers,
-- Abel Braaksma
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--