Hi Christian,

Yes, writing 'CHOP=OFF' in .basex stops the vanishing of whitespace.

But where in the XQuery or XDM spec does it say that whitespace handling when 
parsing is implementation dependent?

Cheers,
Jos


On dinsdag 16 februari 2021 22:10:30 CET Christian Grün wrote:
> Hi Jos,
> 
> Whitespaces will be preserved if the CHOP option is disabled. You can make
> this a default by adding CHOP=false in your .basex configuration file [1,2].
> 
> Hope this helps,
> Christian
> 
> [1] https://docs.basex.org/wiki/Full-Text#Mixed_Content
> [2] https://docs.basex.org/wiki/Configuration
> 
> 
> 
> 
> Jos van den Oever <j...@vandenoever.info> schrieb am Di., 16. Feb. 2021,
> 
> 22:00:
> > Dear all,
> > 
> > First off: BaseX is great to work with. I use it for a few statically
> > generated websites.
> > 
> > But I recently found what might be a bug.
> > 
> > Some whitespace vanishes when loading xml files. E.g. this xml file:
> > 
> > ```test.xml
> > <a> a b <a> c </a> d e </a>
> > ```
> > 
> > run like this:
> > 
> > doc('test.xml')
> > 
> > gives:
> > 
> > <a>a b<a>c</a>d e</a>
> > 
> > But running this:
> > 
> > ```
> > parse-xml('<a> a b <a> c </a> d e </a>')
> > ```
> > 
> > retains the whitespace.
> > 
> > I've tested this with BaseX 7.0, 8.0, 9.0 and 9.4.6.
> > 
> > Running this in saxon-he-10.3.jar retains the whitespace.
> > 
> > I can work around this issue by placing xml:space="preserve" in the
> > document
> > element.
> > 
> > I cannot come up with a scenario in which discarding whitespace during is
> > parsing is ok when no DTD or XML Schema is provided.
> > 
> > Best regards,
> > Jos

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to