[xsl] XSLT 2.0: On xsl:sequence and xsl:copy-of

Subject: [xsl] XSLT 2.0: On xsl:sequence and xsl:copy-of
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 10 Oct 2003 19:57:59 +0200
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




  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 name="v2">
      <xsl:sequence select="/"/>

    <xsl:copy-of select="$v1 except $v2"/>

Should the output of this code be empty or not? If not, what should the
output be?


Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread