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

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
bds
Posts: 43

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

Thu Nov 23, 2017 12:46 am

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.
bds
Posts: 43

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

Thu Nov 23, 2017 12:53 am

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.
Radu
Posts: 5131

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

Thu Nov 23, 2017 8:22 am

Hi,

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

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “Common Problems”

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest