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 Zhitao Wang <zw...@pointone.ws> on 2002/04/30 22:27:38 UTC

XPATH help

Hello

I am very new to Xpath. I just installed Xindice 1.0 
on WinXP, and added the following to a collection 
under /db called qt

<?xml version="1.0"?>
<product product_id="120320">
   <description>Glazed Ham</description>
</product>

Then I  used 
xindice xpath_query -c /db/data/products -q
'/product[@product_id="120320"]'

to query it.

I heard a beep and see the DEBUG sign in Xindice running window.

(I can start Xindice and I have no idea how to make it run in the
backgroud. 
help needs on this too).

Thanks much

ZT

Re: XPATH help

Posted by Colin Huang <ch...@ceo.ca>.
The collection you query does not match the collection you added the XML
file to.
xindice xpath_query -c /db/qt -q '/product[@product_id="120320"]'




----- Original Message -----
From: "Zhitao Wang" <zw...@pointone.ws>
To: <xi...@xml.apache.org>
Sent: Tuesday, April 30, 2002 4:27 PM
Subject: XPATH help



Hello

I am very new to Xpath. I just installed Xindice 1.0
on WinXP, and added the following to a collection
under /db called qt

<?xml version="1.0"?>
<product product_id="120320">
   <description>Glazed Ham</description>
</product>

Then I  used
xindice xpath_query -c /db/data/products -q
'/product[@product_id="120320"]'

to query it.

I heard a beep and see the DEBUG sign in Xindice running window.

(I can start Xindice and I have no idea how to make it run in the
backgroud.
help needs on this too).

Thanks much

ZT



Re: XPATH help

Posted by "Mark J. Stang" <ma...@earthlink.net>.
Try:

xindice xpath_query -c /db/data/products -q
"/product[@product_id='120320']"

Reverse the quotes.   On Windows you need double quotes so that windows
will
parse it correctly.

HTH,
Mark

Zhitao Wang wrote:

> Hello
>
> I am very new to Xpath. I just installed Xindice 1.0
> on WinXP, and added the following to a collection
> under /db called qt
>
> <?xml version="1.0"?>
> <product product_id="120320">
>    <description>Glazed Ham</description>
> </product>
>
> Then I  used
> xindice xpath_query -c /db/data/products -q
> '/product[@product_id="120320"]'
>
> to query it.
>
> I heard a beep and see the DEBUG sign in Xindice running window.
>
> (I can start Xindice and I have no idea how to make it run in the
> backgroud.
> help needs on this too).
>
> Thanks much
>
> ZT