RE: XSLT: Adding optional select attribute to xsl:copy

Thanks for the suggestion. We're currently looking at a proposal to add
select attributes to a number of instructions that don't currently have
them. xsl:copy is one that I was having difficulty with, because the
semantics could become fairly complex, but we'll bear the suggestion in
mind.

I think one problem with your suggestion is that it's not obvious whether
xsl:copy with a select attribute should change the context node. In your
example it clearly should, but I can think of other examples where this
would be confusing.

Michael Kay

> -----Original Message-----
> From: Ellis Cohen [mailto:e.cohen@acm.org] 
> Sent: 04 June 2003 18:44
> To: public-qt-comments@w3.org
> Subject: XSLT: Adding optional select attribute to xsl:copy
> 
> 
> 
> It would be useful to optionally add a select attribute to 
> xsl:copy, especially if (as with copy-of) if it could be used 
> for shallow copies of a number of elements during pull-style 
> processing
> 
> For example, instead of writing
> 
> <xsl:for-each select="book">
>    <xsl:copy>
>      <xsl:copy-of select="title"/>
>      <xsl:copy-of select="publisher"/>
>    </xsl:copy>
> </xsl:for-each>
> 
> it would be more succint to simply write
> 
> <xsl:copy select="book">
>    <xsl:copy-of select="title"/>
>    <xsl:copy-of select="publisher"/>
> </xsl:copy>
> 
> 
> 
> 

Received on Thursday, 5 June 2003 04:58:14 UTC