[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: deep copy without attributes

Subject: Re: deep copy without attributes
From: Graydon <graydon@xxxxxxxxx>
Date: Tue, 21 May 2013 05:52:49 -0400
Re:  deep copy without attributes
On Tue, May 21, 2013 at 01:35:54AM +0100, Ihe Onwuka scripsit:
> On Tue, May 21, 2013 at 12:02 AM, Graydon <graydon@xxxxxxxxx> wrote:
> > <xsl:template match="node()">
> >     <xsl:copy>
> >         <xsl:apply-templates select="node()"/>
> >     </xsl:copy>
> > </xsl:template>
> >
> > does that; it's not recursive, it's a single template.  It'll get
> > applied to all the nodes, but that's the magic of the XSLT declarative
> 
> if it were only about  whether cognoscenti can think up an elegant
> solution - we'd still all be doing Muenchian Grouping.

To know about Muenchian Grouping, which is not, alas, elegant, merely
effective, and not know about the identity template seem really odd.

I would also note that understanding the xsl:for-each-group instruction
is in no way obviously easier than understanding Muenchian Grouping!
More capable, more readily applied, I think more powerful even in the
fully formal sense, yes, but it's not an easy instruction to understand.

Identity template processing is surely basic; one of the four basic
patterns for an XSLT program, and I'd argue the _most_ basic of those
four.

Really not wanting to deal with the declarative model, well, yes.  That
is certainly widely observed.  But XSLT _is_ the declarative model.

> I've not been paying attention to 3.0 but I'd be looking at copy-of
> and thinking it is ripe for accepting an anonymous function/template
> that is applied as it traverses it's hierarchy. which would be another
> way of addressing the issue.

Which would be a horrible mistake; copy-of is useful in significant part
because it is a way to say "the whole subtree, you don't have to think
about it" to the optimizer.

Thinking of XSLT programming as a conversation with the optimizer isn't
entirely basic, but it's a good habit all the same.

-- 
Graydon Saunders
graydon@xxxxxxxxx

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.