Subject: Re: [xsl] What does this XPath expression mean ? From: Justin Johansson <procode@xxxxxxxxxxx> Date: Sat, 22 Mar 2008 22:22:33 +1000 |
The for-each expression is to iterate over a selected nodeset, that being defined by the select attribute (yes, you knew that) The selected nodeset is all of the child nodes of the 'testResults' element, X, filtered by a predicate, P. The unfiltered nodeset, X, is specified by the partial expression, '/testResults/*'. The predicate is 'not(@label = preceding::*/@label)'. So the final result nodeset is all the nodes selected by X excluding the nodes not statisifed by the predicate, P. My guess is that you are having trouble interpreting the meaning of the predicate. If this the case, you may find the answer you require as follows: The predicate (or filter expression) is the logical complement of @label = preceding::*/@label which factors out the not() wrapper. So that leaves you with understanding that the nodes (rather, elements) *not* to be included in the result are all the elements with an attribute named 'label' are to be equal to any preceding element with the same label. Now that is more-or-less of the matter but there are some finer points of XPath semantics that others on this fine list will no doubt amplify. Hope this helps, though my answer is not complete in exact detail. Cheers, Justin Johansson >Could someone be kind to help me breaking down the XPath to explain what the expression means ? > > <xsl:for-each select="/testResults/*[not(@label = preceding::*/@label)]">
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] What does this XPath expressi, Z W | Thread | Re: [xsl] What does this XPath expr, Kamal |
[xsl] What does this XPath expressi, Z W | Date | Re: [xsl] What do these expressions, Martin Honnen |
Month |