xmltools
xmltools copied to clipboard
Trim whitespace from TEXT nodes during pretty print
See discussion in #55
Trimming means the following:
" this is a text " => "this is a text"
Complexities in child elements:
The only first text-child of a node can be left-trimmed and the only last text-child of a node can be right-trimmed.
I agree with the summary about line break addition, keeping in mind that CDATA behave like TEXT. This means that
<tag> <![CDATA[ x ]]> </tag>
will output
<tag><![CDATA[ x ]]></tag>
when "Trim text whitespace" is enabled, and
<tag> <![CDATA[ x ]]> </tag>
when "Trim text whitespace" is disabled. The content of CDATA block keeps always untouched.
But it then must take xml:space into account.