True, the documentation of the command-line flags hasn’t been updated
for quite a while now. I’ve just caught up on that. BaseX 9.1.1 is
scheduled for tomorrow, it will include the updated help texts.
On Thu, Dec 13, 2018 at 2:32 PM Zimmel, Daniel wrote:
>
> Looks like I was not getting the
Looks like I was not getting the toggle part correctly.
Yes it is very confusing since it says:
"-w Preserve whitespaces from input files"
Thanks! I will toggle this now in my internal documentation :-)
> -Ursprüngliche Nachricht-
> Von: Christian Grün
> With the same query, when CHOP=false in the .basex file and -w switch on the
> command line, whitespace gets chopped (not expected!)
The option is toggled (see one of my previous replies). We should
revise the help text on the command-line in a future version.
Thanks for the hint. Yes, in my .basex there is a CHOP=false; when I delete it,
it works as expected.
But as I pointed out, this looks like a bug to me:
With the same query, when CHOP=false in the .basex file and -w switch on the
command line, whitespace gets chopped (not expected!)
Input
This is what I get:
REPLACED
eins
Do you possibly have some settings in your .basex configuration file
that I should consider? Or do you have a 'test' database with chopped
whitespaces that is opened instead of your test.xml document?
On Thu, Dec 13, 2018 at 1:43 PM Zimmel,
I was referring to XQuery update writeback, chop option is set to false:
$ basex.bat -u -w -c"set exporter omit-xml-declaration=no,indent=no" -itest.xml
update.xquery
update.xquery:
for $c in doc(document-uri())//kennung
return
(replace value of node $c with "REPLACED")
test.xml:
test
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
…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
> 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
I already tried setting serialization params in .basex, per command line switch
and as declare variable.
Any serialization parameter gets ignored from the command line with XQuery
Update.
I found an ancient report about this behaviour in the archives, but no solution:
Hi Daniel,
> Unfortunately, I still have not found a way to force BaseX NOT to delete my
> xml declaration with any update operation on a given input file.
The XML declaration is a part of the serialization process. You can
enable it by adding…
SERIALIZER=omit-xml-declaration=no,indent=no
…to
Thank you Christian, changing the argument order does help indeed with the
whitespace! The documentation is slightly vague about this.
Unfortunately, I still have not found a way to force BaseX NOT to delete my xml
declaration with any update operation on a given input file.
For example if I
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
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
14 matches
Mail list logo