Subject: RE: [xsl] sorting question From: "Lars Huttar" <lars_huttar@xxxxxxx> Date: Tue, 27 May 2003 15:17:13 -0500 |
> I want to process all 'sd:Service' nodes that have > sd:ServiceDescription/@ServiceName='Y', > except the one with min 'sd:ServiceID'. > > What is the condition returning the node-set I want ? > (I have done it by " xsl:sort + xsl:if test='position() > 1'> ", > but I would like more elegant solution -> only one xsl:for-each) I don't know of any way more elegant. Maybe you're thinking of something that uses simply a select expression without any xsl:sort or xsl:if, e.g. select="/*/sd:Service[sd:ServiceDescription/@ServiceName='Y' and ../sd:Service[sd:ServiceID < current()/sd:ServiceID]]" except that current() isn't correct for giving the context node of the outer predicate (I don't know how to do that... can anyone say if it's possible?). Also you may need to repeat and sd:ServiceDescription/@ServiceName='Y' in the inner predicate if that's what you want. But even if this worked, I don't think this would really be a win because it could be much less efficient (order N*N) than your original approach (order N * log N for sorting). Don't think I helped much but nobody else had replied. Lars XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] sorting question, Margarit A. Nickolov | Thread | Re: [xsl] sorting question, Margarit A. Nickolov |
RE: [xsl] position() seems always t, Lars Huttar | Date | Re: [xsl] jfor doesn't work under l, me |
Month |