PDA

View Full Version : Roadmap for XQuery Persistence (aka XQuery Update Facility)



Dazed
9th November 2010, 23:21
I've done quite a lot of looking and reading around the QDom and QXmlPatterns functionality. I'm after the ability to run XQuery/XPath on XML data and persist changes.

Having started with QDomDocument and it's persistance functionality (appendChild, removeChild(), set and save() etc) I saw reference that QXmlPatterns is now prefered to QDomDocument. However QXmlPatterns has no 'obvious' persistence mechanisms. Unless sub-classing QSimpleXmlNodeModel or QAbstractXmlNodeModel is how this is done.

I'm actually now wondering if XQuery Update Facility has been, or is still planned to be, implemented within Qt.

I see it was being considered a couple of years ago http://lists.trolltech.com/qt-interest/2008-06/thread00653-0.html and an expired task-tracker for "Add XQuery Update Facility to Qt's XQuery Support" (http://qt.nokia.com/developer/task-tracker/index_html?method=entry&id=214284) but can't see any reference in Qt 4.6 or 4.7.

Any view or am I missing something? - this would be a great :cool: addition.

wysota
9th November 2010, 23:47
QXmlPatterns is now prefered to QDomDocument.
I wouldn't say that was true. Qt's xml patterns is not a replacement for QDomDocument. Both have their advantages and disadvantages.


However QXmlPatterns has no 'obvious' persistence mechanisms. Unless sub-classing QSimpleXmlNodeModel or QAbstractXmlNodeModel is how this is done.
Qt's XQuery implementation is strictly read-only. So far at least and I wouldn't bet it would change in any definite future unless some Qt user implements it.

Dazed
10th November 2010, 00:30
Thanks, I agree on the pros and cons point and have been using both. However, what I am really after the benefits of a join between them both (as I see others are from a number of related threads) and particularly the ability to XPath within a multi-document set and persist changes.

A key quote is from the developer of QXmlPatterns (having seen the @author tags in the code) admittedly made in 2008 is:

http://lists.trolltech.com/qt-intere...ad00653-0.html


The reason for that there is no QtXmlPatterns<->QDom glue is fairly
deliberate. The problem is that QDom is very old and has issues which are
hard to live with and which becomes more visible by integrating with
QtXmlPatterns. So our idea is to remove the need for such glue, by providing
new functionality which is better. XQuery Update, for instance.


Which sounded fairly authoritative to me, although obviously not a formal commitment. I appreciate that adding XQuery Update (http://www.w3.org/TR/xquery-update-10/) would be a non-trivial piece of work.

If anyone is working along these lines, either inside Qt labs or elsewhere I for one would be keen to know.

wysota
10th November 2010, 00:35
It doesn't say anywhere here that QDomDocument is bad/deprecated/obsolete/worse-than-QtXmlPatterns. It's just different.

Dazed
10th November 2010, 08:53
Agreed - unfortunately, on it's own, it doesn't meet my requirement.

What it does imply though is that there was intent within Qt development to add this capability (if not the actual Update feature) - just trying to get a current view on the status of that.