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

Re: Grouping simple flat structure

Subject: Re: Grouping simple flat structure
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 17 Mar 2008 15:16:16 +0000
Re:  Grouping simple flat structure
On 17/03/2008, Ian Proudfoot <ian.proudfoot@xxxxxxxxxxx> wrote:
> Thank you Andrew. I was not aware of the sibling recursion template.
>  As I was already using the basic identity transform template, I replaced it
>  with the modified version, but now some elements are not being copied to the
>  output. Should it be possible to swap these two templates without re-working
>  other templates?

Not really because a node that doesn't apply-templates to it's
following sibling will stop the recursion, whereas using the standard
identity the following sibling will get processed because of the
existing apply-templates call that was made from its parent.

For example:

<foo>
   <bar/>
   <baz/>
   <bar/>
</foo>

with a no-op template for baz:

<xsl:template match="baz"/>

Here using the standard identity template both <bar>s will get
processed because of the <xsl:apply-templates/> call when the context
node was <foo>.

However using sibling recursion only the first <bar> is processed from
<foo>, then <baz/> then it stops, so using sibling recursion every
template has a responsibility to process its following sibling.


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.