My guess is that you don't have the namespace declaration exactly
correct.

 

DW

 

________________________________

From: Iveland, Espen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 21, 2006 4:08 AM
To: user@xmlbeans.apache.org
Subject: XPath problem

 

Hi,

 

I want to make a query using xpath against an XMLObject, but no matter
what I put in my query, I get the same exception:

 

java.lang.RuntimeException:  Trying XBeans path engine... Trying XQRL...
Trying Saxon... FAILED on <my query string>
 at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:131)
 at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:91)
 at org.apache.xmlbeans.impl.store.Cursor._selectPath(Cursor.java:902)
 at org.apache.xmlbeans.impl.store.Cursor.selectPath(Cursor.java:2634)
 at
org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.j
ava:431)
 at
org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.j
ava:415)
 ...

 

A typical query that fails may look like:

 

String query = "declare namespace s='http://<my.name.space>;" +
               "$this/s:objects/s:object/s:id eq " + id;

 

 

I use XML beans 2.2.0 and have tried saxon 8.6.1 and 8.8 with the same
result. My classpath includes (in this order) saxon8.jar,
saxon8-xpath.jar, xbean.jar and jsr173_1.0_api.jar. I see that many
people have the same problem, but I have not seen a solution. I have
limited experience with xpath, so the problem could be there, but I am
really stuck. Any help would be appreciated.

 

Thanks

Reply via email to