Dear J Gager,
thank for your e-mail..
We have tried a number of approaches to this (more to come on this in a separate email). One such approach is to insert the documents as nodes into the container using XQuery. Example:
insert nodes document {<t:test xmlns:t='xyz' xmlns:s='def'>good <s:test>bye</s:test></t:test>} into collection('MyCollection')
Unfortunately, the XQuery Update specification does not allow for the insertion of new document nodes in collections. This is why your query will insert the child node of the document node (i.e. the root element <t... >) into an existing collection or document. It looks like a bug, however, that one namespace is lost by the update. I added a bug entry for this one..
https://sourceforge.net/tracker/?func=detail&aid=2941714&group_id=19...
Has anyone else encountered such issues? Currently we are working around this by saving the XML content to a file and using the Add process - which seems to work as expected. If possible, we would prefer to avoid this extra step of saving the XML to a temporary file before adding it to our BaseX database.
Right, that's one way to go.. My answer on your second question is coming soon.
Best, Christian