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 Chuck Amadi <ch...@breconbeacons.org> on 2002/10/03 15:31:26 UTC

Re: xpath problem with xindice

Jeff Greif wrote:

>Please be more specific about your problem.  There need be no attributes in
>either the document or the query in order to use XPath.  XPath also allows
>various functions to be applied to the text of an element.  Perhaps a look
>at the XPath spec or some XPath tutorial would be helpful.
>
>Jeff
>----- Original Message -----
>From: "Chuck Amadi" <ch...@breconbeacons.org>
>To: <xi...@xml.apache.org>
>Sent: Tuesday, October 01, 2002 5:20 AM
>Subject: xpath problem with xindice
>
>
>>Hi there I'm having difficulty running xpath It seems that you need to
>>have a node & attribute in oder to run the query Please advice if it's
>>possible to use another notation as The xml documents I have residing in
>>my NXD'S have very usefully query strings to find information as I
>>intended from the start to have as less attributes as possible.
>>and use Elements <nodes)as often as possible .
>>
>
>
Sorry for the confusing remarks by me xpath does work albiet it didn't 
do anthing when I tried _

}$ xindice xpath -c /db/xmlproject -q /article/section[@label="clear"] -v

only worked when I tried this }$ xindice xpath -c /db/xmlproject -q 
 /article /section -v
thus the node and attribute have been omitted. I will take a look at a 
tutorial but I'm fairly comfortable with xpath .

-- 
Regards 
Chuck Robert Amadi
ICT Dept Systems Programmer.
Rhaglenydd Systemau Adran ICT.
Power too deliver.
Y gallu i y Dosbarthu.

Before you criticize someone,
you should walk a mile in their shoes.
That way, when you criticize them,
you're a mile away, and you have their shoes.





Re: xpath problem with xindice

Posted by Terry Rosenbaum <Te...@amicas.com>.
Chuck Amadi wrote:

> ... it didn't do anthing when I tried _
>
> }$ xindice xpath -c /db/xmlproject -q /article/section[@label="clear"] -v
>
> only worked when I tried this }$ xindice xpath -c /db/xmlproject -q 
> /article /section -v
> thus the node and attribute have been omitted. ...

This is unlikely the cause of your problem, but since it is an outside 
possibility
I will mention it:

If you have a collection configured with
<collection compressed="false" name="xmlproject"> bla bla ...
and you have a value index on "section@label", the
results of your query qualified on section[@label="clear"] will be 
exactly as
you saw -- nothing selected. This is due to a bug in Xindice.

I say this is unlikely since most people probably have not
tried to use compressed="false".

-Terry

> Jeff Greif wrote:
>
>> Please be more specific about your problem.  There need be no 
>> attributes in
>> either the document or the query in order to use XPath.  XPath also 
>> allows
>> various functions to be applied to the text of an element.  Perhaps a 
>> look
>> at the XPath spec or some XPath tutorial would be helpful.
>>
>> Jeff
>> ----- Original Message -----
>> From: "Chuck Amadi" <ch...@breconbeacons.org>
>> To: <xi...@xml.apache.org>
>> Sent: Tuesday, October 01, 2002 5:20 AM
>> Subject: xpath problem with xindice
>>
>>
>>> Hi there I'm having difficulty running xpath It seems that you need to
>>> have a node & attribute in oder to run the query Please advice if it's
>>> possible to use another notation as The xml documents I have 
>>> residing in
>>> my NXD'S have very usefully query strings to find information as I
>>> intended from the start to have as less attributes as possible.
>>> and use Elements <nodes)as often as possible .
>>>
>>
>>
> Sorry for the confusing remarks by me xpath does work albiet it didn't 
> do anthing when I tried _
>
> }$ xindice xpath -c /db/xmlproject -q /article/section[@label="clear"] -v
>
> only worked when I tried this }$ xindice xpath -c /db/xmlproject -q 
> /article /section -v
> thus the node and attribute have been omitted. I will take a look at a 
> tutorial but I'm fairly comfortable with xpath .
>