Qizx fully supports XQuery Update Facility 1.0 as specified in the W3C's Working Draft dated 28 August 2007.
This extension allows updating XML documents using four primitive operations insert, delete, replace and rename. It also defines a copy/modify/return instruction which allows transforming an XML tree by first copying it, then updating the copy using the four primitive operations.
For a more detailed introduction, please read the XQuery Update tutorial available on the Qizx web site.
The XQuery Update specifications leave some room for implementation-specific features. Here are the specifics in Qizx:
When an XQuery expression is updating (as defined in the specifications), corresponding updates are automatically performed at the end of the execution of the expression.
Transactions: by default commit() is performed for each XQuery expression execution that updates one document (or several documents) in an XML Library. This auto-commit can be disabled and re-enabled through an API method Library.setAutoCommitting(). When auto-commit is disabled, the commit() method has to be called explicitly.
Working on parsed documents[2] in memory is possible, but updates are not saved, because source documents can be specified as any URL (for example HTTP), and it is hardly feasible or even desirable to actually perform such changes.
To update a document stored in a file, we recommend using the copy/modify/return instruction, then the serialization function x:serialize on the result. Thus the user has full control on how the document is written back to the source.
The standard function fn:put() is equivalent to xlib:write-document (though with a different argument order).
It can only write to a document of an XML Library. The node must be a document-node or an element.
Deleting a parentless node raises an error err:XUDY0020.
External functions cannot perform updates (i.e return update lists).
[2] "parsed documents" are documents which are not stored in an XML Library, but loaded into memory by XML parsing a file or from an URL.