Bug #2380
closedreturnfield system needs to implement more xpath
0%
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.
Related issues
Updated by Saurabh Garg about 18 years ago
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>
Updated by Chad Berkley about 18 years ago
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 ***