Ah, now this makes it much more clear in the documentation, I just checked the wiki page history.
The only thing is I prefer the Saxon default about not changing anything on already existing indentation (BaseX is deleting any indentation with indent=no), but I am aware this is implementation-defined.
Thanks for the update, Daniel
-----Ursprüngliche Nachricht----- Von: Christian Grün [mailto:christian.gruen@gmail.com] Gesendet: Mittwoch, 12. Dezember 2018 18:47 An: Zimmel, Daniel Cc: BaseX Betreff: Re: [basex-talk] Command line options not working with update operation on input file
…I think I got what you were trying to achieve! There is a separate option for exporting databases and writing updates. This may be more obvious now after another updates of our documentation [1].
Here is a little self-contained BaseX call that (as I hope) demonstrates the behavior:
basex -u -c"set exporter omit-xml-declaration=no" "file:write('doc.xml', <a/>)" "insert node <b/> into doc('doc.xml')/*" "fetch:xml('doc.xml')"
<?xml version="1.0" encoding="UTF-8"?>
<a> <b/> </a>
You can also run the following command script ("basex script.bxs"):
set exporter omit-xml-declaration=no set writeback on xquery file:write('doc.xml', <a/>) xquery insert node <a/> into doc('doc.xml')/* xquery fetch:xml('doc.xml')
Maybe we’ll merge these two options in a future release of BaseX. Until then, just add an EXPORTER option to your .basex file with the identical serialization parameters.
Best Christian
[1] http://docs.basex.org/wiki/Options#WRITEBACK
On Wed, Dec 12, 2018 at 6:35 PM Christian Grün christian.gruen@gmail.com wrote:
Any serialization parameter gets ignored from the command line with XQuery
Update.
Has this been solved? Is this a bug?
XML declarations are never stored in the database. Instead, they will be added during serialization. So I’m not exactly on what you just tried to do. Could you please give some step-by-step instructions?