Hi Daniel.
The argument order is important in BaseX; you could try the following variant:
basex.bat -u -w -ifile.xml -sindent=no update.xquery
If this doesn’t help, you could append the CHOP=true in your .basex configuration file.
Hope this helps Christian
On Fri, Dec 7, 2018 at 3:40 PM Zimmel, Daniel D.Zimmel@esvmedien.de wrote:
Hello,
can anyone give me a hint on the behaviour of the command line options in BaseX 9.0.2?
When I try an update operation on a file given with "-i", neither the option "-w" nor any serialisation option gets evaluated; while the update operation with "-u" is working correctly, my whitespace gets happily chopped.
CCL: $ basex.bat -ifile.xml -sindent=no -u -w update.xquery XQ: for $c in doc(document-uri())//element return replace value of node $c with "TEST"
A workaround is using fetch:xml() with document-uri(), which does leave any whitespace intact and does no indentation (no parameters necessary).
declare variable $doc := document-uri(); for $c in fetch:xml($doc)//element return replace value of node $c with "TEST"
Unfortunately my requirement is I cannot use specific BaseX-functions in this specific update script.
My XML:
<root> <vs> <kennung>Kennung</kennung> <absatz> <fett>eins</fett> </absatz> <absatz id="sgb04_k_para067_p67_a0001_a0001"> Test <fett>fett</fett> <kursiv>kursiv</kursiv> Text Text.</absatz> </vs> </root>
Thanks, Daniel