Hi Lukas and Andy. The use of wildcards solved the issue and I see now why BaseX stated that it couldn't find the insertion point.
Thanks again!
C.
From: Andy Bunce [mailto:bunce.andy@gmail.com] Sent: lunes, 08 de julio de 2013 14:13 To: Carlos MARCOS LAGUNAR Cc: basex-talk Subject: Re: [basex-talk] "XUDY0027 - Insert target must not be empty" with default namespaces
Or if you really want two and three in no namespace like your first example your starting data should be:
<one xmlns="oneone">
<two xmlns="" />
</one>
/Andy
On Mon, Jul 8, 2013 at 1:05 PM, Lukas Kircher lukaskircher1@gmail.com wrote:
Hi Carlos,
the element <two/> in the second example is also bound to the default
namespace, so you have to take care of this. Adding a wildcard to the
name test (.../*:two) should do the trick. Your final insert query then looks
like this:
insert node <three/> into db:open("MyDB", "q471pa0lnovkfflso7ecsd6nj1.xml")/*:one/*:two
If the problem persists just get back to us.
Hope this helps, have a nice day,
Lukas
On Mon, Jul 8, 2013 at 1:49 PM, Carlos MARCOS LAGUNAR carlos.marcos@atosresearch.eu wrote:
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.
------------------------------------------------------------------ This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network,
the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. Este mensaje y los ficheros adjuntos pueden contener informacion confidencial destinada solamente a la(s) persona(s) mencionadas anteriormente
pueden estar protegidos por secreto profesional. Si usted recibe este correo electronico por error, gracias por informar inmediatamente al remitente y destruir el mensaje. Al no estar asegurada la integridad de este mensaje sobre la red, Atos no se hace responsable por su contenido. Su contenido no constituye ningun compromiso para el grupo Atos, salvo ratificacion escrita por ambas partes. Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor no puede garantizar nada al respecto y no sera responsable de cualesquiera danos que puedan resultar de una transmision de virus. ------------------------------------------------------------------
_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
------------------------------------------------------------------ This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.
Este mensaje y los ficheros adjuntos pueden contener informacion confidencial destinada solamente a la(s) persona(s) mencionadas anteriormente pueden estar protegidos por secreto profesional. Si usted recibe este correo electronico por error, gracias por informar inmediatamente al remitente y destruir el mensaje. Al no estar asegurada la integridad de este mensaje sobre la red, Atos no se hace responsable por su contenido. Su contenido no constituye ningun compromiso para el grupo Atos, salvo ratificacion escrita por ambas partes. Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor no puede garantizar nada al respecto y no sera responsable de cualesquiera danos que puedan resultar de una transmision de virus. ------------------------------------------------------------------