W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2003

Re: www.w3.org/TR/xslt20/#element-copy-of

From: Jeni Tennison <jeni@jenitennison.com>
Date: Mon, 12 May 2003 14:20:38 +0100
Message-ID: <7-1424511609.20030512142038@jenitennison.com>
To: David.Pawson@rnib.org.uk
CC: public-qt-comments@w3.org

Hi Dave,

> This draft contains:
>
> <xsl:copy-of
>   select = expression
>   copy-namespaces = "yes" | "no"
>   validation = "strict" | "lax" | "preserve" | "strip"
>   type = qname />
>
> In the previous draft the separator attribute was present.
>
> In generating a pipe separated list in XSLT with text method output,
> I found that attribute very useful.
>
> What alternative replaces it please?
> If none,
>   what was the justification for its removal?

Since you're using the text output method, and thus only interested in
generating text nodes, the <xsl:value-of> element should give you what
you want:

  <xsl:value-of select="$sequence" separator="|" />

In all other cases, you can use exactly the same code as you can in
XSLT 1.0, namely:

  <xsl:for-each select="$sequence">
    <xsl:copy-of select="." />
    <xsl:if test="position() != last()">|</xsl:if>
  </xsl:for-each>

We removed the separator attribute from <xsl:copy-of> mainly because
it doesn't play well with the fact that <xsl:copy-of> can now generate
sequences of atomic values.
  
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Monday, 12 May 2003 09:20:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:24 GMT