[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|