Hi Jonathan,
If you work with whitespace-sensitive documents, it’s recommendable to add the following two options at the end of your .basex configuration file:
... # Local Options CHOP = false SERIALIZER = indent=no
The first option will ensure that no whitespaces will be chopped when parsing documents. The second one will disable automatic indentation.
Apart from that, you’ll still need to be aware that whitespaces will often be dropped if you use node constructors (that’s the default behavior of the spec):
<x> </x>
You can avoid that by adding explicit spaces:
<x>{ ' ' }</x>
Feel free to share your queries with us.
Best, Christian
On Fri, Jul 16, 2021 at 12:52 AM Jonathan Robie jonathan.robie@gmail.com wrote:
I am doing some transformations of datasets, then submitting pull requests to upstream sources on GitHub. For instance, today I am inserting some attributes, but I may be restructuring in various ways or enhancing data in various ways.
To make upstreams happy, I need to be disciplined about not changing whitespace.
What do I have to do? Is it sufficient to preserve whitespace when importing, do an XQuery update, and export, or can that change whitespace beyond what the update operations explicitly say?
Thanks!
Jonathan