|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Grouping / unique list with just XPath
> The problem is that I don't know the schema of the incoming files but
> they're channeled through a recursive single template, so fiddling
> around with keys to capture something that I currently trap in
> <xsl:choose /> contraptions seem a bit tricky,
I don't really understand why you can't use keys. You indicated you
could use the another suggested method
> select="$variable/member[@ref-id!=preceding-sibling::member/@ref-id]"
> This will catch the first ref-id of each value.
You need to know exactly the same information to use this method, the
element names member and the attribute name ref-id, and one form can be
mechanically converted to the other:
<xsl:key name="m" name="match" use="@ref-id"/>
...
<xsl:for-each select="$variable/member[generate-id()=generate-id(key('m',@ref-id))]">
well that selects the first member with each id, rather than just
testing for first sibling, you can add the idof the parent if you need
that.
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
________________________________________________________________________
|
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
|

Cart








