Bug #2380
closed
returnfield system needs to implement more xpath
Added by Chad Berkley over 18 years ago.
Updated about 18 years ago.
Description
The XPath system used when processing the returnfield params is inadequate when
you want to proceess data out of a document that contains a lot of xml
attributes. For instance, if you have an entity like this:
<sometag name="x" value="y"/>
It is impossible to pull the 'value' attribute from the xml based on the 'name'
attribute. The correct xpath query for pulling the value 'y' from this is
/sometag[@name=x]/@value. This syntax is not supported by the returnfield
processor, but it should be.
If I understand the bug correctly, then this functionality is already present in
src/edu/ucsb/nceas/metacat/QuerySpecification.java. So what needs to be investigated first is that if the functionality is not working. Here is a test query which worked fine for me
<pathquery version="1.0">
<querytitle>unspecified</querytitle>
<returnfield>@docid</returnfield>
<returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype>
<returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype>
<querygroup operator="UNION">
<queryterm casesensitive="false" searchmode="contains">
<value>gce</value>
</queryterm>
</querygroup>
</pathquery>
this is a duplicate of another ecogrid bug. the query statement in sid's comment does not do what the query statement in my original posting does. i.e. @docid is not the same as /x[@docid='x']/@value. I need to be able to be able to pull one attribute based on the value of another in the same element.
- This bug has been marked as a duplicate of 2650 ***
Original Bugzilla ID was 2380
Also available in: Atom
PDF