Re: xpath expression to find which element
Sorry, was misled by the subject.
Peter Flyn has provided an answer.
Another possibility is to use <xsl:number> , depending on what you mean
by "the position of the element"
Cheers,
Dimitre Novatchev
"Dimitre Novatchev" <dimitren@tpg.com.au> wrote in message
news:43f78548$0$12881$892e7fe2@authen.yellow.readf reenews.net...[color=blue]
> /*/*[.='c']
>
>
> Cheers,
> Dimitre Novatchev
>
>
>
>
> "Steve" <smsinger3@newsgroup.nospam> wrote in message
> news:6320D8CE-180D-4173-92D7-771D2CDB7FE1@microsoft.com...[color=green]
>> Hello.. I have been trying to figure this out for the last hour, but I am
>> baffled... I'm hoping someone can help!
>>
>> I'm trying to write an xpath expression to find the position of the node
>> with value "c" in the following xml. The result I'm looking for in this
>> case
>> should be 3. Does anyone have any ideas?
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <TopNode>
>> <FieldDefinition>a</FieldDefinition>
>> <FieldDefinition>b</FieldDefinition>
>> <FieldDefinition>c</FieldDefinition>
>> <FieldDefinition>d</FieldDefinition>
>> <FieldDefinition>e</FieldDefinition>
>> </TopNode>
>>
>> My idea was something like:
>>
>> /*/position(". = 'c'")
>>
>> But that doesn't work.
>>
>> Could anyone please help! Thank you very much in advance.
>> --
>> Steve[/color]
>
>[/color]
|