Jens Teubner wrote:
Hi MonetDB/XQuery folks,
I'm in the midst of implementing the support for the "official" XQuery Update Facility syntax. So far it looks like the current code is pretty good in line with the W3C draft. The update operations in the draft are very similar to the update functions we currently have. A few questions, however, appeared when implementing the new syntax:
-- It seems to me like we do not (yet) have a rename() function that only changes the tag name of a given element, attribute, or processing-instruction node.
That's correct, we don't have such a function.
-- It is not clear to me how our current insert-...() functions handle attributes in the new node list.
The new nodes may contain attributes. They are inserted with the new nodes.
The W3C draft provides separate upd:insertAttributes ($element, $attlist) and upd:insertBefore ($element, $nodelist) functions (and similar). The translation from the surface syntax to the update operations then takes care of invoking the right functions.
Is upd:insertAttributes similar to our set-attribute function (except that set-attribute works on a single attribute)?
Unfortunately, this translation (the split-up of attributes and the rest in particular) is non-trivial in XQuery Core. So we could--in line with the current implementation of element construction--push this treatment of attributes into the back-end.
Any comments on this? How does the current code deal with attributes in the arguments of insert-...()?
They're inserted.
So far for now,
Jens
-- Sjoerd Mullender