Hi,
I’m working with latests BaseX distribution. The problem arises when I change from a specific namespace to a default namespace on the XML file. From that moment on the insertion becomes messy, since some of them fail. Example:
Here is the source XML that I insert into the newly created DataBase:
<n:one xmlns:n="oneone">
<two />
</n:one>
I execute then a xquery to insert a node into the empty tag “two”: insert node <three/> into db:open("MyDB", "q471pa0lnovkfflso7ecsd6nj1.xml")/*:one/two
In that case, I get a successful insertion: If I query the file (db:open("MyDB", "q471pa0lnovkfflso7ecsd6nj1.xml")/*:one) I get:
<n:one xmlns:n="oneone">
<two>
<three />
</two>
</n:one>
This is the normal behavior. The problem comes when I try to set that namespace as the default. So I create a new DataBase with the following XML:
<one xmlns="oneone">
<two />
</one>
When I try to execute the same xquery as before (insert node <three/> into db:open("MyDB", "q471pa0lnovkfflso7ecsd6nj1.xml")/*:one/two) I get the following error:
rg.basex.core.BaseXException: Stopped at line 1, column 84: [XUDY0027] Insert target must not be empty
I cannot understand then why the namespace affects the insertion this way :-/ I’m querying and insertion from a Java application by using JavaClient, although I guess this is not relevant here.
Any help would be appreciated.
Thank you and best regards,
C.