You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Eric Zhang <yu...@ualberta.ca> on 2004/02/20 22:53:20 UTC

Java Application Vs. Commandline Tool

XPath query on the string value of element/attribute works in java
application connected to the xindice, but not from command line

XML
<book>
<chapter name="eric"/>
<chapter>test</chapter>
</book>

XPath Query
//chapter[@name="eric"]

Works from a java app, but failed to find the doc from xindice's command
line tool.


-- 
Yue(Eric) Zhang
Database Analyst/DBA, TAPoR Project
Arts Department, University of Alberta
Edmonton, AB, Canada


Re: Java Application Vs. Commandline Tool

Posted by Dan Alford <da...@appraisalforum.com>.
Eric,
Please check out

http://wiki.apache.org/xindice/XindiceFAQ/AttributeValue

The basic problem is you have to enclose the whole xpath in double 
quotes and single quote any values when running from the windows command 
line.

So change your command line query to: "//chapter[@name='eric']"

Regards,
Dan
Eric Zhang wrote:

>XPath query on the string value of element/attribute works in java
>application connected to the xindice, but not from command line
>
>XML
><book>
><chapter name="eric"/>
><chapter>test</chapter>
></book>
>
>XPath Query
>//chapter[@name="eric"]
>
>Works from a java app, but failed to find the doc from xindice's command
>line tool.
>
>
>  
>