In the latest draft of XSLT 2.0 one of the major new additions is the
xsl:sequence instruction.
Although it is not well-explained, one may conclude from the description
that it is used to produce references to nodes as opposed to copies of
nodes. I have some observations and questions about xsl:sequence and
xsl:copy-of in XSLT 2.0:
O1. The name xsl:sequence is not the best possible name for this xslt
instruction. Now that everything is a sequence in XPath 2.0, the word
sequence has become a buzz word and its overuse (not to say misuse) can only
lead to confusion. If the result of this instruction is placing references
to nodes in the output, then a more exact name would be one of the
following:
xsl:reference
xsl:add-reference
xsl:node-reference
O2. xsl:sequence does everything that can be done with xsl:copy-of and
these two xslt instructions are mutually redundant.
Q1. Is there anything that can be accomplished with xsl:copy-of and which
cannot be accomplished by using xsl:sequence?
Q2. Is there any compelling reason of keeping xsl:copy-of in the language
(apart for compatibility with XSLT 1.0)?
Q3. Let's have:
<xsl:variable name="v1">
<xsl:sequence select="/"/>
</xsl:variable>
<xsl:variable name="v2">
<xsl:sequence select="/"/>
</xsl:variable>
<xsl:copy-of select="$v1 except $v2"/>
Should the output of this code be empty or not? If not, what should the
output be?
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list