[xsd-users] DbXml update

Boris Kolpackov boris at codesynthesis.com
Fri Aug 1 10:57:28 EDT 2008


Hi Michael,

Boris Kolpackov <boris at codesynthesis.com> writes:

> I've written to the DB XML folks to find out if they have plans 
> to support this in the near future. Will let you know what they 
> say.

Ok, I've had a lengthy discussion with the DB XML folks regarding
this issue. In short, currently there is no way to update a document
fragment (as returned in XmlValue by a query) other than maybe running
another XQuery.

They are, however, thinking of extending the API to allow something
along these lines (not an actual interface):

XmlValue v;
XmlResults res(mgr.query(...));
if (res.next(v)) {
        XmlResults fragRes = mgr.createResults();

        XmlEventWriter &w = fragRes.asEventWriter();
        // write
        w.close();

        // see this function, below
        replaceNode(mgr, v, fragRes);
}

void replaceNode(XmlManager &mgr, XmlValue &v, XmlResults &res)
{
        XmlQueryContext qc = mgr.createQueryContext();
        qc.setVariableValue("node", $v);
        qc.setVariableValue("newNode", $res);
        mgr.query(qc, "replace node $node with $newNode");
}

As you can see it will still involve XQuery so I don't know what
kind of performance this method can achieve (though the DB XML
folks say that it will be faster than the DOM approach). It also
requires the user to perform a lot more actions compared the old
approach.

Generally, the common theme in our discussion was that they want
to minimize the number of different ways it is possible to update
documents so XQuery becomes the only way. This is obviously not how
we think people prefer to perform complex document modifications so
I am not sure there will be future for the XSD/DB XML integration
should they go this direction. They, however, welcome feedback
from their users, especially the paying ones ;-). So feel free to
let them know how you use DB XML and what you need in terms of APIs.

Boris




More information about the xsd-users mailing list