Question about an xpath depending on two xml nodes - XML SOAP
This is a discussion on Question about an xpath depending on two xml nodes - XML SOAP ; Hi,
in my case I've got the following XML document:
<doc>
<item>
<foo>1</foo>
<bar>a</bar>
</item>
<item>
<foo>2</foo>
<bar>b</bar>
</item>
</doc>
My question is, if it is possible to read out the value of a child if
another childnode has a ...
-
Question about an xpath depending on two xml nodes
Hi,
in my case I've got the following XML document:
<doc>
<item>
<foo>1</foo>
<bar>a</bar>
</item>
<item>
<foo>2</foo>
<bar>b</bar>
</item>
</doc>
My question is, if it is possible to read out the value of a child if
another childnode has a specific value. In my example I want to read out
the value of the foo node when the value of the bar node is an 'a'. Is
this possible?
Thanks in advance
Martin
-
Re: Question about an xpath depending on two xml nodes
Martin Horst wrote:
> My question is, if it is possible to read out the value of a child if
> another childnode has a specific value. In my example I want to read out
> the value of the foo node when the value of the bar node is an 'a'. Is
> this possible?
Yes, easily,
/doc/item[bar = 'a']/foo
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
-
Re: Question about an xpath depending on two xml nodes
Hi,
Martin Honnen schrieb:
> Martin Horst wrote:
>
>> My question is, if it is possible to read out the value of a child if
>> another childnode has a specific value. In my example I want to read
>> out the value of the foo node when the value of the bar node is an
>> 'a'. Is this possible?
>
> Yes, easily,
> /doc/item[bar = 'a']/foo
>
>
yeah thanks. This is realy easy. I thought this is only possible with
attributes. I think I'm falling in love with xpaths.
Best regards
Martin
Similar Threads
-
By Application Development in forum DOTNET
Replies: 0
Last Post: 08-08-2007, 05:42 PM
-
By Application Development in forum XML SOAP
Replies: 1
Last Post: 07-03-2007, 07:21 AM
-
By Application Development in forum XML SOAP
Replies: 0
Last Post: 12-21-2006, 11:48 PM
-
By Application Development in forum XML SOAP
Replies: 2
Last Post: 05-25-2006, 07:53 AM
-
By Application Development in forum Clarion
Replies: 6
Last Post: 04-25-2005, 03:37 PM