Hi all Yesterday, I posted a bug report for dbXML stating that Resources returned by XPathQueryService return no ID to the source document. Tom Bradford explained to me, that this behaviour is by design.
I hope you, Tom, don't mind my quoting you here: > This is not a bug. The query systems, particularly XPath > queries have the ability to return partial and aggregated > results. The data that is being returned is not promised to > be the original document, and so no ID can actually be > associated with the resources returned. > > The XPath query system does return namespaced attributes in > each returned node that allows you to resolve the document > that the node originated from, but even using this > information to delete documents based on node results will > result in improper behavior (deleting an entire document > when you only want to delete a node, for example) > > Use XUpdate to perform updates and deletions in a more > predictable fashion. You can find out more about the > XUpdate spec at http://www.xmldb.org/xupdate/index.html I looked through the XML:DB documentation again, to make sure I haven't overlooked anything. This behaviour isn't documented, yet, which is a bad thing (Please correct me if that's not the case). For XML:DB to be widely accepted a good documentation is crucial to ensure that all implementations work alike and users know what to expect. What Tom explained to me is a fact I can accept and live with, but I'm not fully confortable with it. When a developer writes XPath queries he/she knows what is expected: whole documents or just subnodes. The developer can determine if a returned ID can be used to perform an operation such as a deletion or a store-away for later use. A big caveat in the documentation should make the use of these IDs secure. Or was it done this way because maybe not all XML:DB implementations are able to return an ID on the source document as dbXML can? Or do we have to account for the possibility of the end user to be able to enter XPath queries? Then we would probably have to be able to analyze the XPath statement to determine the effects. I can see that XUpdate can be used to update (insert, update, delete nodes) a document. But I don't see how exactly I can delete whole documents using XUpdate. You can probably delete the root node, but does the source document get deleted from the collection this way? Can someone please enlighten me? Here is my use case, I'm not sure how to perform in a generic way, i.e. without relying on dbXML and its "src:key" attribute: "Delete all documents created in a given date range." Where the XML instances have the following sample structure: <doc created="2001-07-02"> <data>...</data> </doc> Thanks a lot for your help. Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029 Internet http://www.outline.ch ---------------------------------------------------------------------- Post a message: mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED] Contact adminstrator: mailto:[EMAIL PROTECTED] Read archived messages: http://archive.xmldb.org/ ----------------------------------------------------------------------