Hi Christian,
You are right about Saxon. The documentation appeared, to me, to suggest the default was preserve, and I didn't check! The documentation is now very clear[1].
"The default is strip, in accordance with Appendix C.1 of the XQuery specification."
I have added a few words to the Wiki [2]
Thanks
/Andy [1] https://www.saxonica.com/documentation12/index.html#!conformance/xquery31 [2] https://docs.basex.org/wiki/BaseX_10#Whitespaces
On Sat, 1 Jul 2023 at 07:41, Christian Grün christian.gruen@gmail.com wrote:
Thanks for the suggestions. I agree that XML whitespace handling will always be a challenge and challenging to grasp… No matter what defaults are used in an implementation. It’s true, our documentation could provide more detail about this; maybe we can spend more time on that in the future. All edits are welcome ;)
I had a look at what Saxon does [2] (item 32). It looks like the Saxon
boundary-space default is preserve.
I believe that Saxon strips boundary space by default as well. At least that’s my command-line experience (I didn’t check how that correlates to the information given in their documentation):
(: query.xq :) <x> </x>
(: call :) java -cp "saxon-he-12.2.jar;xmlresolver-5.1.1.jar" net.sf.saxon.Query query.xq
(: result :)
<?xml version="1.0" encoding="UTF-8"?><x/>
Best, Christian