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/19 22:36:49 UTC

XPath doesn't work

In my experiment, XPath query doens't work on the character value of
attribute/element, but works on integer value of attribute/element.

My simple doc:

<book>
<div>first</first>
<div>1</div>
<div name="second"/>
<div name="2"/>
</book>

XPath query don't work:
   //div="first"
   //div[@name="second"]

XPath query work:
   //div="1"
   //div[@name="2"]

What's the problem. I am using version1.0

On Wed, 2004-02-18 at 19:49, Vadim Gritsenko wrote:
> lilia ighmouracene wrote:
> 
> > hello,
> >
> > 1) i try to perform this xindice query within cocoon:
> >
> > http://localhost:8080/cocoon/db/PROTO/Medical/medical.xml?xpath=//*[@id='pfranck' 
> > <http://64.4.30.250/cgi-bin/linkrd?_lang=FR&lah=c854706ed7856be8a74db95196822cf2&lat=1077123587&hm___action=http%3a%2f%2flocalhost%3a8080%2fcocoon%2fdb%2fPROTO%2fMedical%2fmedical%2exml%3fxpath%3d%2f%2f%2a%5b%40id%3d%27pfranck%27>]
> > but i have the follow message error
> >  
> > "Référence à un préfixe d'espace de noms non déclaré  "
> >  
> > i have the response to the query but not wellformed because the prefix 
> > xmldb which is used by xindice in the response is not declared as a 
> > name space.
> >  
> > what i must do to resolve this problem,
> 
> 
> Does this query work from command line? It might be Cocoon related 
> problem, not Xindice.
> 
> 
> > 2) a nother problem, when i perform this query in xindice  //@* , i 
> > havent a response why
> 
> 
> Xindice XML-RPC driver currently does not support attribute results. See 
> test cases ("build test-integration-xmlrpc test-report", see 
> build/test-report/)
> 
> Vadim
-- 
Yue(Eric) Zhang
Database Analyst/DBA, TAPoR Project
Arts Department, University of Alberta
Edmonton, AB, Canada


RE: XPath doesn't work

Posted by Jim Fuller <ji...@ruminate.co.uk>.
> XPath query don't work:
>    //div="first"

This is not valid xpath, this type of test should always be put in a
predicate, e.g. square brackets as your next example shows;

>    //div[@name="second"]
> 
> XPath query work:
>    //div="1"
>    //div[@name="2"]
> 
> What's the problem. I am using version1.0

I would suggest that you upgrade your version of xindice firstly, as no
one including the prolific Vadim supports it, and there are still some
rather big bugs with it.

gl, Jim Fuller