I am using xmlbeans 2.3.0 and I am trying to use xpath to query a
document. I am trying to run the example under
{xbeans_dist}\samples\XQueryXPath. My classpath includes all of the
distributed jars (including xbean_xpath.jar) and saxon8.jar. When trying
to run the xpath from the example which is:
declare namespace
xq='http://xmlbeans.apache.org/samples/xquery/employees';$this/xq:employ
ees/xq:employee/xq:phone/[EMAIL PROTECTED]'work']
Any time I run any xpath I get the exception below. Any help is greatly
appreciated. I've also tried saxon9 with the same result.
java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL...
Trying Saxon... FAILED on declare namespace
xq='http://xmlbeans.apache.org/samples/xquery/employees';$this/xq:employ
ees/xq:employee/xq:phone/[EMAIL PROTECTED]'work']
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)
at
org.apache.xmlbeans.samples.xquery.SelectPath.updateWorkPhone(SelectPath
.java:75)
at
org.apache.xmlbeans.samples.xquery.XQueryXPath.executeQueries(XQueryXPat
h.java:84)
at
org.apache.xmlbeans.samples.xquery.XQueryXPath.main(XQueryXPath.java:54)
Exception in thread "main" java.lang.RuntimeException: Trying XBeans
path engine... Trying XQRL... Trying Saxon... FAILED on declare
namespace
xq='http://xmlbeans.apache.org/samples/xquery/employees';$this//xq:emplo
yee/xq:name/text()
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:894)
at
org.apache.xmlbeans.impl.store.Cursor.selectPath(Cursor.java:2616)
at
org.apache.xmlbeans.samples.xquery.SelectPath.collectNames(SelectPath.ja
va:133)
at
org.apache.xmlbeans.samples.xquery.XQueryXPath.executeQueries(XQueryXPat
h.java:87)
at
org.apache.xmlbeans.samples.xquery.XQueryXPath.main(XQueryXPath.java:54)
Thank you
Joe