Hi guys,
I'm having a weird thing with BaseX, it's probably something I do wrong, but I can't find what it is so I am asking your help.
I am PUTting a XML document to the JAX-RX server:
================================================ PUT /basex/jax-rx/lexus/2e7a78c8-fdce-488b-993e-019ad812bc04 HTTP/1.1 Content-Type: text/xml; charset=UTF-8 Authorization: Basic YWRtaW46YWRtaW4= User-Agent: Jakarta Commons-HttpClient/3.1 Host: localhost:8489 Content-Length: 699099
<?xml version="1.0" encoding="UTF-8"?> <lexus id="uuid:2e7a78c8-fdce-4993e-019ad812bc04"> <meta version="1.0"> <name>Lexicon</name> <description>lexicon</description> <note>[This lexicon was imported by demo on 2011-06-24T12:48:02.194+02:00.]
</note> <owner ref="uuid:2c9090a20ad6bf2e009f096563"/> <users> <user ref="uuid:2c9090a20ad6bf2e01f096563"> <permissions> <read>true</read> <write>true</write> </permissions> </user> </users> <schema> <container admin-info="" description="" id="MmM5MDkwYTIxNjdjMjFkNzAxMTY4MDQ2OTg5MTRhMDE=" mandatory="true" multiple="false" name="lexicon" note="" type="lexicon"> <container admin-info="" description="Represents a word, a multi-word expression, or an affix in a given language" id="uuid:5f5be48f-089b-4da3-9493-ea302b082fb7" note="" type="lexical-entry"> <container admin-info="" description="" id="uuid:09775cfd-acaf-46cd-98f8-ca878386d133" mandatory="false" multiple="true" name="lexemeGroup" note="" type="container"> <container xmlns:dcr="http://www.isocat.org/ns/dcr" admin-info="http://www.isocat.org/datcat/DC-1325" dcr:datcat="http://www.isocat.org/datcat/DC-1325" description="Minimal unit of language which : has a semantic interpretation and embodies a distinct cultural concept. " id="uuid:a8eb40c4-2068-462d-946b-031a74202a68" mandatory="false" multiple="true" name="lexeme" note="" type="data"/> ================================================
etc. Note the xmlns:dcr declaration. (I am using tcpmon to see what's sent and received. So tcpmon is sitting just in between my app and the JAX-RX server.)
When I request the document I am getting something I do not expect, the xmlns:dcr seems to be replaced with a xmlns:xhtml and therefor I receive an error when processing the jax-rx result:
The query:
================================================ POST /basex/jax-rx/ HTTP/1.1 Content-Type: application/query+xml; charset=UTF-8 Authorization: Basic YWRtaW46YWRtaW4= User-Agent: Jakarta Commons-HttpClient/3.1 Host: localhost:8489 Content-Length: 673
<?xml version="1.0" encoding="UTF-8"?> <query> <text> (: Returns lexus/meta element :) element lexus { attribute id { 'uuid:2e7a78c8-fdce-4993e-019ad812bc04' }, collection('lexus')/lexus[@id eq 'uuid:2e7a78c8-fdce-4993e-019ad812bc04']/meta } </text> <parameter name="output" value="media-type=text/xml; omit-xml-declaration=no"/> </query> ================================================
and the result:
================================================ HTTP/1.1 200 OK Content-Type: text/xml;omit-xml-declaration=no Content-Length: 15285 Server: Jetty(6.1.25)
<jax-rx:results xmlns:jax-rx="http://jax-rx.sourceforge.net%22%3Ejax-rx:result<lexus id="uuid:2e7a78c8-fdce-4993e-019ad812bc04"> <meta version="1.0"> <name>Lexicon</name> <description>lexicon</description> <note>[This lexicon was imported by demo on 2011-06-24T12:48:02.194+02:00.]</note> <owner ref="uuid:2c9090a20ad6bf2e010b22509f096563"/> <users> <user ref="uuid:2c9090a20ad6bf2e010b22509f096563"> <permissions> <read>true</read> <write>true</write> </permissions> </user> </users> <schema> <container admin-info="" description="" id="MmM5MDkwYTIxNjdjMjFkNzAxMTY4MDQ2OTg5MTRhMDE=" mandatory="true" multiple="false" name="lexicon" note="" type="lexicon"> <container admin-info="" description="Represents a word, a multi-word expression, or an affix in a given language" id="uuid:5f5be48f-089b-4da3-9493-ea302b082fb7" note="" type="lexical-entry"> <container admin-info="" description="" id="uuid:09775cfd-acaf-46cd-98f8-ca878386d133" mandatory="false" multiple="true" name="lexemeGroup" note="" type="container"> <container xmlns:xhtml="http://www.w3.org/1999/xhtml" admin-info="http://www.isocat.org/datcat/DC-1325" dcr:datcat="http://www.isocat.org/datcat/DC-1325" description="Minimal unit of language which : has a semantic interpretation and embodies a distinct cultural concept. " id="uuid:a8eb40c4-2068-462d-946b-031a74202a68" mandatory="false" multiple="true" name="lexeme" note="" type="data"/> ================================================
I vaguely remember having seen this before, but I can't find it in the mailing list archive, so sorry if I missed an obvious answer, and please help me anyway.
Hartelijke groet,
Huib Verweij.
Hi Huib,
I'm very sorry that you have had to wait that long for an answer, in addition I'm positive that this is not an error on your side.
So far I'm not able to give you a hint, but maybe you can give me some more details:
1. Have you been running any updates between PUT/POST?
2. The 'dcr' prefix declaration went missing in the returned <container> node, ok. Is there anything you left out in your PUT example regarding the input document? So far I can see that it is not the complete document, but maybe you stripped some details before the corrupt container element as well?
Thank you very much, regards, Lukas
On Fri, Jun 24, 2011 at 1:24 PM, Huib Verweij hhv@home.nl wrote:
Hi guys,
I'm having a weird thing with BaseX, it's probably something I do wrong, but I can't find what it is so I am asking your help.
I am PUTting a XML document to the JAX-RX server:
================================================ PUT /basex/jax-rx/lexus/2e7a78c8-fdce-488b-993e-019ad812bc04 HTTP/1.1 Content-Type: text/xml; charset=UTF-8 Authorization: Basic YWRtaW46YWRtaW4= User-Agent: Jakarta Commons-HttpClient/3.1 Host: localhost:8489 Content-Length: 699099
<?xml version="1.0" encoding="UTF-8"?>
<lexus id="uuid:2e7a78c8-fdce-4993e-019ad812bc04"> <meta version="1.0"> <name>Lexicon</name> <description>lexicon</description> <note>[This lexicon was imported by demo on 2011-06-24T12:48:02.194+02:00.]
</note>
<owner ref="uuid:2c9090a20ad6bf2e009f096563"/> <users> <user ref="uuid:2c9090a20ad6bf2e01f096563"> <permissions> <read>true</read> <write>true</write> </permissions> </user> </users> <schema> <container admin-info="" description="" id="MmM5MDkwYTIxNjdjMjFkNzAxMTY4MDQ2OTg5MTRhMDE=" mandatory="true" multiple="false" name="lexicon" note="" type="lexicon"> <container admin-info="" description="Represents a word, a multi-word expression, or an affix in a given language" id="uuid:5f5be48f-089b-4da3-9493-ea302b082fb7" note="" type="lexical-entry"> <container admin-info="" description="" id="uuid:09775cfd-acaf-46cd-98f8-ca878386d133" mandatory="false" multiple="true" name="lexemeGroup" note="" type="container"> <container xmlns:dcr="http://www.isocat.org/ns/dcr" admin-info="http://www.isocat.org/datcat/DC-1325" dcr:datcat=" http://www.isocat.org/datcat/DC-1325" description="Minimal unit of language which : has a semantic interpretation and embodies a distinct cultural concept. " id="uuid:a8eb40c4-2068-462d-946b-031a74202a68" mandatory="false" multiple="true" name="lexeme" note="" type="data"/> ================================================
etc. Note the xmlns:dcr declaration. (I am using tcpmon to see what's sent and received. So tcpmon is sitting just in between my app and the JAX-RX server.)
When I request the document I am getting something I do not expect, the xmlns:dcr seems to be replaced with a xmlns:xhtml and therefor I receive an error when processing the jax-rx result:
The query:
================================================ POST /basex/jax-rx/ HTTP/1.1 Content-Type: application/query+xml; charset=UTF-8 Authorization: Basic YWRtaW46YWRtaW4= User-Agent: Jakarta Commons-HttpClient/3.1 Host: localhost:8489 Content-Length: 673
<?xml version="1.0" encoding="UTF-8"?>
<query> <text> (: Returns lexus/meta element :) element lexus { attribute id { 'uuid:2e7a78c8-fdce-4993e-019ad812bc04' }, collection('lexus')/lexus[@id eq 'uuid:2e7a78c8-fdce-4993e-019ad812bc04']/meta } </text> <parameter name="output" value="media-type=text/xml; omit-xml-declaration=no"/> </query> ================================================
and the result:
================================================ HTTP/1.1 200 OK Content-Type: text/xml;omit-xml-declaration=no Content-Length: 15285 Server: Jetty(6.1.25)
<jax-rx:results xmlns:jax-rx="http://jax-rx.sourceforge.net%22%3Ejax-rx:result<lexus id="uuid:2e7a78c8-fdce-4993e-019ad812bc04"> <meta version="1.0"> <name>Lexicon</name> <description>lexicon</description> <note>[This lexicon was imported by demo on 2011-06-24T12:48:02.194+02:00.]</note> <owner ref="uuid:2c9090a20ad6bf2e010b22509f096563"/> <users> <user ref="uuid:2c9090a20ad6bf2e010b22509f096563"> <permissions> <read>true</read> <write>true</write> </permissions> </user> </users> <schema> <container admin-info="" description="" id="MmM5MDkwYTIxNjdjMjFkNzAxMTY4MDQ2OTg5MTRhMDE=" mandatory="true" multiple="false" name="lexicon" note="" type="lexicon"> <container admin-info="" description="Represents a word, a multi-word expression, or an affix in a given language" id="uuid:5f5be48f-089b-4da3-9493-ea302b082fb7" note="" type="lexical-entry"> <container admin-info="" description="" id="uuid:09775cfd-acaf-46cd-98f8-ca878386d133" mandatory="false" multiple="true" name="lexemeGroup" note="" type="container"> <container *xmlns:xhtml="http://www.w3.org/1999/xhtml%22*admin-info=" http://www.isocat.org/datcat/DC-1325" dcr:datcat=" http://www.isocat.org/datcat/DC-1325" description="Minimal unit of language which : has a semantic interpretation and embodies a distinct cultural concept. " id="uuid:a8eb40c4-2068-462d-946b-031a74202a68" mandatory="false" multiple="true" name="lexeme" note="" type="data"/> ================================================
I vaguely remember having seen this before, but I can't find it in the mailing list archive, so sorry if I missed an obvious answer, and please help me anyway.
Hartelijke groet,
Huib Verweij.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi Lukas,
Op 1 jul 2011, om 13:42 heeft Lukas Kircher het volgende geschreven:
1. Have you been running any updates between PUT/POST?
No.
2. The 'dcr' prefix declaration went missing in the returned <container> node, ok. Is there anything you left out in your PUT example regarding the input document? So far I can see that it is not the complete document, but maybe you stripped some details before the corrupt container element as well?
Not really, no elements or attributes were left out in between the root and the element with the missing namespace declaration.
I've been playing with curl, uploading a document to the newly created "test" database and everything works fine. However, when I do the same but instead upload to the "lexus" database (the one I use for my webapp) I lose the namespace declaration again.
And I really do not know what to say now, so I'll leave it at that ;-).
Hartelijke groet,
Huib Verweij.
-- Drs. Huib Verweij Senior software developer - The Language Archive Max Planck Institute for Psycholinguistics P.O. Box 310 6500 AH Nijmegen The Netherlands t +31-24-3521911 e huib.verwey@mpi.nlmailto:huib.verwey@mpi.nl w http://www.mpi.nl/
Op 4 jul 2011, om 08:59 heeft Huib Verwey het volgende geschreven:
I've been playing with curl, uploading a document to the newly created "test" database and everything works fine. However, when I do the same but instead upload to the "lexus" database (the one I use for my webapp) I lose the namespace declaration again.
And I really do not know what to say now, so I'll leave it at that ;-).
Actually I do have comments.
Just to be clear: the "lexus" database was not empty like the "test" database.
We see the same behavior on our test machine and on our acceptation machine.
I tried another experiment using curl and the basexclient. I cleared the "lexus" db with the "delete /" command. Then I uploaded the test document with the dcr: attribute. When retrieving the test document, it was OK. Then I uploaded all the Lexus documents that were in the database before. When retrieving the test document, it was still OK. Then I cleared the database again, but immediately uploaded all the Lexus documents that were in the database before. After that I added the test document again. When I retrieved the test document it was missing the dcr namespace.
Odd huh?
Hartelijke groet,
Huib Verweij. -- Drs. Huib Verweij Senior software developer - The Language Archive Max Planck Institute for Psycholinguistics P.O. Box 310 6500 AH Nijmegen The Netherlands t +31-24-3521911 e huib.verwey@mpi.nlmailto:huib.verwey@mpi.nl w http://www.mpi.nl/
Hi Huib,
your last email cleared things up a bit, thanks. At least I can imagine now where this strange (and for sure incorrect) behavior originates.
Is it possible for you to strip down the problem to a more basic version?
Regards, Lukas
On Mon, Jul 4, 2011 at 1:46 PM, Huib Verwey Huib.Verwey@mpi.nl wrote:
Op 4 jul 2011, om 08:59 heeft Huib Verwey het volgende geschreven:
I've been playing with curl, uploading a document to the newly created "test" database and everything works fine. However, when I do the same but instead upload to the "lexus" database (the one I use for my webapp) I lose the namespace declaration again.
And I really do not know what to say now, so I'll leave it at that ;-).
Actually I do have comments.
Just to be clear: the "lexus" database was not empty like the "test" database.
We see the same behavior on our test machine and on our acceptation machine.
I tried another experiment using curl and the basexclient. I cleared the "lexus" db with the "delete /" command. Then I uploaded the test document with the dcr: attribute. When retrieving the test document, it was OK. Then I uploaded all the Lexus documents that were in the database before. When retrieving the test document, it was still OK. Then I cleared the database again, but immediately uploaded all the Lexus documents that were in the database before. After that I added the test document again. When I retrieved the test document it was missing the dcr namespace.
Odd huh?
Hartelijke groet,
Huib Verweij.
Drs. Huib Verweij Senior software developer - The Language Archive Max Planck Institute for Psycholinguistics P.O. Box 310 6500 AH Nijmegen The Netherlands t +31-24-3521911 e huib.verwey@mpi.nl w http://www.mpi.nl/
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi Lukas,
you're bugfix in Git worked! Thanks again, we're happily importing everything now.
Hartelijke groet,
Huib Verweij.
Op 4 jul 2011, om 22:19 heeft Lukas Kircher het volgende geschreven:
Hi Huib,
your last email cleared things up a bit, thanks. At least I can imagine now where this strange (and for sure incorrect) behavior originates.
Is it possible for you to strip down the problem to a more basic version?
Regards, Lukas
On Mon, Jul 4, 2011 at 1:46 PM, Huib Verwey Huib.Verwey@mpi.nl wrote:
Op 4 jul 2011, om 08:59 heeft Huib Verwey het volgende geschreven:
I've been playing with curl, uploading a document to the newly created "test" database and everything works fine. However, when I do the same but instead upload to the "lexus" database (the one I use for my webapp) I lose the namespace declaration again.
And I really do not know what to say now, so I'll leave it at that ;-).
Actually I do have comments.
Just to be clear: the "lexus" database was not empty like the "test" database.
We see the same behavior on our test machine and on our acceptation machine.
I tried another experiment using curl and the basexclient. I cleared the "lexus" db with the "delete /" command. Then I uploaded the test document with the dcr: attribute. When retrieving the test document, it was OK. Then I uploaded all the Lexus documents that were in the database before. When retrieving the test document, it was still OK. Then I cleared the database again, but immediately uploaded all the Lexus documents that were in the database before. After that I added the test document again. When I retrieved the test document it was missing the dcr namespace.
Odd huh?
basex-talk@mailman.uni-konstanz.de