[Interest] Restricting QXmlQuery to QPath 2.0

Elvis Stansvik elvstone at gmail.com
Sat Oct 18 14:03:48 CEST 2014


Hi folks,

I'm considering using QtXmlPatterns, but I need to be able to restrict
queries to only accept XPath 2.0 expressions, not the full XQuery 1.0
language.

This seems impossible at the moment; QXmlQuery supports either XQuery10 or
XSLT20 as values for queryLanguage. However, the QueryLanguage enum has a
hidden value XPath20 for internal purposes. I took a quick look, and this
seems to be used internally when parsing of XPath 2.0 expressions in XSLT
2.0.

I'm hoping someone intimately familiar with the query code can answer:
Would it be possible/feasible to add third public mode to the query parser,
one in which only XPath 2.0 is accepted? Or is this too much work / out of
scope?

I haven't looked too closely at the code, but XPath 2.0 is a subset of
XQuery 1.0, so my hope is that it would not be an insurmountable effort to
add this. But I may be wrong. Also, I suspect QtXmlPatterns might not be
actively worked on except for bugfixing?

Cheers,
Elvis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141018/e1094e4c/attachment.html>


More information about the Interest mailing list