Hi Christian. You are completely right, sorry for make this more complex than it actually is :-)
Please find attached a single method class that runs "out of the box". It ends with the error " javax.xml.xquery.XQQueryException: [BXDB0006]: Database path 'TEST01/58745896522DFEF.xml' must point to a single document. " on the last query (insert node...).
Best regards,
C.
-----Original Message----- From: Christian Grün [mailto:christian.gruen@gmail.com] Sent: lunes, 11 de marzo de 2013 18:22 To: Carlos MARCOS LAGUNAR Cc: BaseX Subject: Re: [basex-talk] Java Client - Error BXDB0006 while accessing a single document
Hi Carlos; sorry for persisting, but your code seems to be incomplete. It would be helpful if you could prepare some Java code that runs out of the box! Thanks, Christian ___________________________
On Mon, Mar 11, 2013 at 5:33 PM, Carlos MARCOS LAGUNAR carlos.marcos@atosresearch.eu wrote:
Hi Christian,
Well, what I'm trying to do is (I think) pretty simple: I just want to add a document (58745896522DFEF.xml) to an existing Collection (MG_USERS) and then insert a new node in the middle of that document. I want to perform all these operations from a Java Client.
For that purpose, I've implemented 3 different clients in Java (First one uses REST API from Java, second used the ClientSession and ClientQuery and the third one uses XQJ API). I'm obtaining the same error on the three clients: BXDB0006 must point to a single document whenever I try to access the previously inserted XML in order to insert the new node in the middle of it.
This is the log of my last attempt:
[BaseX] executing command: DELETE MG_USERS/58745896522DFEF.xml [BaseX] executing command: ADD TO MG_USERS/58745896522DFEF.xml <?xml version="1.0" encoding="utf-8"?><n:vmr xmlns:n="org.opencds.vmr.v1_0.schema.vmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="org.opencds.vmr.v1_0.schema.vmr file:vmr.xsd"></n:vmr> [BaseX] executing query:collection('MG_USERS/58745896522DFEF.xml') [BaseX] executing query: for $docu in fn:collection("MG_USERS") return $docu __ <n:vmr xmlns:n="org.opencds.vmr.v1_0.schema.vmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="org.opencds.vmr.v1_0.schema.vmr file:vmr.xsd"/> [BaseX] executing query: for $doc in collection('MG_USERS') where matches(document-uri($doc), 'doc.xml') return $doc [BaseX] executing query: insert node <patient> </patient> into fn:doc("MG_USERS/58745896522DFEF.xml")/vmr BaseXAPI_XQJ[BXDB0006]: Database path 'MG_USERS/58745896522DFEF.xml' must point to a single document.
Please find attached the code of my XQJ Client (my other two clients are pretty similar to this in structure) and the calling class.
Thank you again and best regards,
C.
-----Original Message----- From: Christian Grün [mailto:christian.gruen@gmail.com] Sent: lunes, 11 de marzo de 2013 17:06 To: Carlos MARCOS LAGUNAR Cc: BaseX Subject: Re: [basex-talk] Java Client - Error BXDB0006 while accessing a single document
Hi Carlos,
Does this mean that I have 3 xml with the same name and the same path?
This only means that your document has three XML nodes (the document node, the root element, and the text node).
I didn't manage to reproduce the issue. Could you provide us with a little, self-contained example?
Best, Christian ___________________________
On Mon, Mar 11, 2013 at 4:32 PM, Carlos MARCOS LAGUNAR carlos.marcos@atosresearch.eu wrote:
Hi Christian and thanks for your reply. Here is the answer:
Input Path Type Content-Type Size
MG_USERS/58745896522DFEF.xml xml application/xml 3
1 Resources.
Does this mean that I have 3 xml with the same name and the same path? O_o But with the REST interface I'm getting just one!.
Thanks again and best regards,
C.
From: Christian Grün [mailto:christian.gruen@gmail.com] Sent: lunes, 11 de marzo de 2013 16:24 To: Carlos MARCOS LAGUNAR Cc: BaseX Subject: Re: [basex-talk] Java Client - Error BXDB0006 while accessing a single document
Hola Carlos,
could you try the list command [1,2] with MG_USERS as argument, and tell us what it prints?
Thanks,
Christian
[1] http://docs.basex.org/wiki/Commands#LIST
[2] http://docs.basex.org/wiki/Database_Module#db:list
On Mon, Mar 11, 2013 at 1:13 PM, Carlos MARCOS LAGUNAR carlos.marcos@atosresearch.eu wrote:
Hello. I've just installed last version of BaseX and have built a Java Client to access it. This is my code:
String query = "insert node <patient>EOEO</patient> into fn:doc("MG_USERS/58745896522DFEF.xml")/vmr"
ClientSession cSes = new ClientSession(URL, PORT, USER, PASS);
ClientQuery cQuery = cSes.query(query);
String res = cQuery.execute();
cQuery.close();
And I'm getting this error:
[BXDB0006] Database path 'MG_USERS/58745896522DFEF.xml' must point to a single document.
I'm pretty sure that there is only ONE document there, since I always execute a DELETE MG_USERS/58745896522DFEF.xml prior of that code you see above. Furthermore, just before executing that code, I check it with a REST call via Internet Explorer and I get just one doc. So I don't really understand why I get the BXDB0006 error.
If I try the same but with the REST interface instead of Java Client, by using:
<rest:query xmlns:rest="http://basex.org/rest%5C%22%3E
insert node <patient>EOEO</patient> into fn:doc("MG_USERS/58745896522DFEF.xml")/vmr
</rest:text>
I get the same error. Could anybody help me with this, please?.
Thank you and best regards,
C.
Carlos Marcos Lagunar
Health Technical Consultant
Research & Innovation
carlos.marcos@atosresearch.eu
Valladolid - Spain
www.atosresearch.eu
es.atos.net
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
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.
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.
------------------------------------------------------------------ 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. ------------------------------------------------------------------