But the key() has to return only one item - otherwise you can't trust the value you get; It may be the position() of the last one found or it could be any other, depending on the XSLT processor...
About the first or last element - did you notice the predicates (square bracket stuff)? Adding [1] to an XPath selection will return only the first element - similarly, adding [last()] will return only the last element.
/Chriztian
PS: Could you maybe mark my first reply as the answer, so other people searching for similar problems can know there is an answer to that specific topic? Thanks.
correct syantax for getting position?
How can I get the position of key('uniqueId',email)?
Hi Merryba,
You can count the number of preceding-siblings:
But the key() has to return only one item - otherwise you can't trust the value you get; It may be the position() of the last one found or it could be any other, depending on the XSLT processor...
/Chriztian
Is there any way to check whether it is the first occurence or second occurence?
Actually, can specify which one you want:
/Chriztian
Hi Chriztian,
Please let me know as how I can get the count of siblings whose emailids start with the number 6 ?
This doesn't help to know whether it is first occurence or last occurence of sibling of the key element
Hi Merryba,
Regarding the "start with the number 6" - there's a starts-with() function available for that, so you'd do something like this:
About the first or last element - did you notice the predicates (square bracket stuff)? Adding [1] to an XPath selection will return only the first element - similarly, adding [last()] will return only the last element.
/Chriztian
PS: Could you maybe mark my first reply as the answer, so other people searching for similar problems can know there is an answer to that specific topic? Thanks.
Thanks Chriztian . That helps.
is working on a reply...