[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Flat to hierarchical with for-each-group (XSLT 2.0 solution)


Subject: Re: [xsl] Flat to hierarchical with for-each-group (XSLT 2.0 solution)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 25 May 2005 17:38:53 +0100

> The only mystery to me is why I had to use test="current-group()[1]/name() 
> = 'heading2'" 

It's best not to use name() (especially if there is any possibility of
namespaces being involved) as name() isn't guaranteed to return the
prefix that you expect, and you are not supposed to care about prefixes
anyway.
"current-group()[1]/self::heading2"
is your friend.


> rather than test="current-group()/heading2" 

that tests if any node in the current group has a heading2 child rather
than testing if it is a heading2.

> just test="heading2"

That tests if the current node has a heading2 child. 

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


Current Thread