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