bug in xmldb:store()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug in xmldb:store()

Adam Retter-7
Hi, I have found a bug in xmldb:store() -

If you call

xmldb:store("/db/mycollection", "myfile.xml") <node>value</node>)

then it stores the node in the file /db/mycollection/myfile.xml and sets
the mime-type to text/xml.

However, if you call

xmldb:store("/db/mycollection", "", <node>value</node)

then exist stores the node in a file of a name of its own choosing in
the collection /db/mycollection, this is fine. But it sets the mime-type
of the file to application/octet-stream, which seems strange considering
it generated a filename like - 5cd5adde.xml. I would have expected the
mime-type to have been text/xml again.

I will try and look into the java code tomorrow if I have time...

Thanks


--
Adam Retter

Devon Portal Developer



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: bug in xmldb:store()

Wolfgang Meier-2
Hi Adam,

line 121 of org/exist/xquery/functions/xmldb/XMLDBStore needs to be changed
from:

String mimeType = "application/octet-stream";

to "text/xml" as default value.

Wolfgang


> If you call
>
> xmldb:store("/db/mycollection", "myfile.xml") <node>value</node>)
>
> then it stores the node in the file /db/mycollection/myfile.xml and sets
> the mime-type to text/xml.
>
> However, if you call
>
> xmldb:store("/db/mycollection", "", <node>value</node)
>
> then exist stores the node in a file of a name of its own choosing in
> the collection /db/mycollection, this is fine. But it sets the mime-type
> of the file to application/octet-stream, which seems strange considering
> it generated a filename like - 5cd5adde.xml. I would have expected the
> mime-type to have been text/xml again.
>
> I will try and look into the java code tomorrow if I have time...
>
> Thanks


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...