xml-xindice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Terry Rosenbaum <Te...@amicas.com>
Subject Re: Document query on command line
Date Fri, 26 Sep 2003 20:35:40 GMT
 > xindice xpath_query -c /db/partsdb -q /parts/part[@sku='']

should return all parts with empty sku attribute

 > xindice xpath_query -c /db/partsdb -q /parts/part[@sku='101']

should return all parts with sku='101'

I would not recommend using double-quotes on the dos prompt.
Use single-quotes around literals instead.

When I ran from the command line, I used bash even on windows
due to its superior control over escaping/quoting characters.
There are some things that are perhaps impossible to
do from the dos command prompt.

-Terry

Shilpa R. Kelkar wrote:

> If I type :
>
> xindice xpath_query -c /db/partsdb -q /parts/part[@sku=""]
>
> I have a collection partsdb and document parts. Above query results 
> back in xml :
>
> <?xml version="1.0"?>
> <part sku="101" xmlns:src="http://xml.apache.org/xindice/Query" 
> src:col="/db/par
> tsdb" src:key="parts">
>       <desc>Ball Bearing</desc>
>       <maker>S.K.F.</maker>
>       <instock>Yes</instock>
>       <price>$20.00</price>
>    </part>
> <?xml version="1.0"?>
> <part sku="102" xmlns:src="http://xml.apache.org/xindice/Query" 
> src:col="/db/par
> tsdb" src:key="parts">
>       <desc>Gasket</desc>
>       <maker>A.B.C.</maker>
>       <instock>Yes</instock>
>       <price>$2.00</price>
>    </part>
>
>
> Although query
> xindice xpath_query -c /db/partsdb -q /parts/part[@sku="101"]  does 
> not  work.
> I am trying to execute this on dos prompt.
>
>
>
>
>
>
>
>
> At 01:53 PM 9/26/2003 -0400, you wrote:
>
>> 1)       ([@sku="101"]       is not a valid XPath
>>
>> 2) If running from MSDOS command line, quoting is problematic.
>> Try, for instance, using single quotes instead of double for literal 
>> values (e.g. '101' instead of "101")
>> and try enclosing the entire expression in double quotes (e.g. 
>> "//*[@sku='101'] ").
>>
>> -Terry
>>
>> Shilpa R. Kelkar wrote:
>>
>>> Hello..
>>>
>>> I am using Xindice command line tool.
>>> I tried the Xpath query on url 
>>> http://www-106.ibm.com/developerworks/opensource/library/wa-xindice.html 
>>> for querying a document ([@sku="101"].
>>>
>>> I followed all the steps given on the page. It does not give me any 
>>> results but just returns to the prompt.
>>>
>>> Any help is appreciated.
>>> Shilpa
>>>
>>
>
>


Mime
View raw message