Dear BaseX team,
I think I observed a bug concerning trailing whitespace in text nodes.
Please consider this input document:
<para>xxx <emphasis role="italic">abc</emphasis> yyy.</para>
[Note the blanks between xxx and <emphasis>.]
The result of the following "null-transformation"
=======================
declare function
local:edit($n as node())
as node()? {
typeswitch($n)
case document-node() return
document {for $c in $n/node() return local:edit($c)}
case element() return
element {node-name($n)}
{for $ac in $n/(@*, node()) return local:edit($ac)}
default return $n
};
local:edit(.)
=======================
should be identical, but what I get is this:
<para>xxx<emphasis role="italic">abc</emphasis>yyy.</para>
The blanks after "xxx" are gone!
When transforming mixed content like docbook, this can have awkware consequences.
Kind regards,
Hans-Jürgen