xml-xindice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Terry Rosenbaum <Te...@AMICAS.com>
Subject Re: evaluating many predicates on multiple nodes
Date Wed, 20 Oct 2004 04:35:19 GMT
Hariharasudhan wrote:

> so basically how do i perform search based on attributes.
> in case by xml is like this
>
> <car type="bar" color="foo">

Assuming you wish to select the above car node, you could use:

/car[@type='bar' and @color='foo']

-Terry

> hi Eno ,
>
> <car>
> <type > bar /type>
> <color> foo </color>
>
> I want to use XPATH to select the cars of type "Mercedes" with color 
> "black" say. Currently I do the following:
> xindice xpath -c /db/CarCollection -q 
> "/car[type='Mercedes']//ancestor::car[color='black'].
>
> ur saying this works right .
>
> but
> /car[type='Mercedes'] --> here car means the root tag <car> ur 
> searching for type ="Mercedes" , so basically how do i perform search 
> based on attributes.
> in case by xml is like this
>
> <car type="bar" color="foo">
>
> Thanks in advance ,
> Hari
>
> When I do good, I feel good; when I do bad, I feel bad.That’s my 
> religion . - Abraham Lincoln
>
>


Mime
View raw message