Page 1 of 1

Editor v19.1 build 2017102417: XPath bug or is it me?

Posted: Thu Nov 23, 2017 12:46 am
by bds
Hi all,

I'm having a weird issue with the XPath/XQuery Builder in v19.1 and I'm not sure if it's me, or a bug, or what. Any thoughts will be greatly appreciated.

Given a file:

Code: Select all


<list>
<entry coll="abc" dept="def" disc="ghi"/>
</list>
Trying to run the following XPath 1.0 query,

Code: Select all

//entry[@dept='def']
using the XQuery/XPath builder, against this file is returning the following error message:

Code: Select all


ro.sync.xml.xpath.g: Prefix must resolve to a namespace: 
at ro.sync.xml.xpath.l.d(Unknown Source)
at ro.sync.xml.xpath.f.cb(Unknown Source)
at ro.sync.xml.xpath.f.ab(Unknown Source)
at ro.sync.exml.editor.xmleditor.i.n.dls(Unknown Source)
at ro.sync.exml.editor.xmleditor.i.n.jls(Unknown Source)
at ro.sync.exml.editor.xmleditor.i.n.kls(Unknown Source)
at ro.sync.exml.editor.xmleditor.i.n.cls(Unknown Source)
at ro.sync.exml.editor.xmleditor.i.n$1.pie(Unknown Source)
at ro.sync.ui.application.nb.run(Unknown Source)
Caused by: org.apache.xpath.domapi.XPathStylesheetDOM3Exception: Prefix must resolve to a namespace:
at org.apache.xpath.compiler.XPathParser.errorForDOM3(XPathParser.java:655)
at org.apache.xpath.compiler.Lexer.mapNSTokens(Lexer.java:647)
at org.apache.xpath.compiler.Lexer.tokenize(Lexer.java:224)
at org.apache.xpath.compiler.Lexer.tokenize(Lexer.java:98)
at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:112)
at org.apache.xpath.XPath.<init>(XPath.java:178)
at ro.sync.xml.xpath.l.g(Unknown Source)
... 9 more
The same query, using the XPath toolbar, works correctly; i.e. returns the highlighted section of the input file.

Am I misusing the XPath/XQuery builder view? Please let me know if I can provide additional details.
Thanks in advance for your time and trouble.

Re: Editor v19.1 build 2017102417: XPath bug or is it me?

Posted: Thu Nov 23, 2017 12:53 am
by bds
Excuse me, please. I think I'm the problem here (PEBKAC) -- I had inserted a comment `(:...:)` above the XPath expression and it looks like that's what was causing the error.

Apologies for the noise.

Re: Editor v19.1 build 2017102417: XPath bug or is it me?

Posted: Thu Nov 23, 2017 8:22 am
by Radu
Hi,

Thanks for the update. Indeed Xquery syntax comments were not supported in XPath 1.0.

Regards,
Radu