Yes, but let's not sidetrack from the original question :) Basically all
examples I have show the attributes example, but I want to nodes
example, where a node is an element. Any answer on that? So is the
following statement the most efficient way:
<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']
Thanks
Eno
Terry Rosenbaum wrote:
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
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|