xml-xindice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grigorios D. Tsoumakas" <g...@csd.auth.gr>
Subject XPath query for an attribute value
Date Mon, 17 Mar 2003 16:07:23 GMT
Hi,

Does anyone know how can I retrieve the value for an
attribute of an element through an XPath Query...
using the Xindice XML:DB API?

For example suppose that I have the following element somewhere
in the xml document in Xindice:

<example shape="circle" color="red">
 
I use the following XPATH query to retrieve all "example"
elements with color "red":

//example[@color='red']

This works, but how do I get to the value of the shape attribute?

Alternatively I tried using the following XPATH query:

//example[@color='red']/@shape

This should actually return the value of the attribute, but it
does not return anything as a ResourceSet...

Any ideas?

----------------------------------------------------------------------
Grigorios D. Tsoumakas, Phd Student
Department of Informatics, Aristotle University of Thessaloniki
Thessaloniki 54124, Greece
tel: +30-310998418   fax: +30-310998419 
home page: http://users.auth.gr/~greg



Mime
View raw message