Dear David, thanks, all observations on potential bugs are welcome. In this case, the behavior is indeed expected (although somewhat counterintuitive): When the document is serialized to disk, we have already lost the information if an XML declaration was specified. Other information, such as DTD declarations and entities, are lost as well as long as they are not explicitly specified as serialization parameters. Best, Christian ___________________________ On Thu, May 12, 2011 at 6:24 AM, David Reichle <dreichle@cableone.net> wrote:
I'm sorry; I wasn't really _trying_ to do anything, except to point out what I consider a bug. Thank-you for your reply.
On Tue, May 10, 2011 at 5:27 AM, Andreas Weiler <andreas.weiler@uni-konstanz.de> wrote:
Hi David,
the following query does what you trying to do (i guess):
declare option output:omit-xml-declaration "no"; put( copy $doc := doc("test.xml") modify insert node <testnew/> into $doc/root return $doc, "test2.xml")
Kind regards, Andreas
On 10.05.2011, at 07:11, David Reichle wrote:
I'm trying to do an update operation on a file using standalone cmdline basex.
The xml-declaration get printed to stdout instead of to the updated file.
$cat test.xml <?xml version="1.0" encoding="UTF-8"?> <root> <test/> </root>
$cat test.xq declare option output:omit-xml-declaration "no";
let $root := doc("test.xml")/root return insert node <test/> into $root
$basex -u test.xq
$cat test.xml <root> <test/> <test/> </root>
The declaration gets removed :<
_______________________________________________ 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