xsl-list
[Top] [All Lists]

RE: [xsl] How can I select only unique combinations of attribute value?

2006-11-17 06:35:52
I thought 
using preceding would look at the preceding node within the 
set being used in the for each, and that has been sorted, but 
this didn't seem to be the case. 

The XPath axes always navigate the tree that the node belongs to. Processing
the nodes in sorted order doesn't change the source tree, so it doesn't
change the result of axis navigation either.


I am going about this in completely the wrong way? 

Yes.

How should 
I compare a node within an iteration of a for-each with the 
same value for the previous node? 

You shouldn't (and you can't).

Or is there a 
different/more efficient way to filter the results down to 
only unique value?

Use xsl:for-each-group in XSLT 2.0, or Muenchian grouping in XSLT 1.0
http://www.jenitennison.com/xslt/grouping

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--