=head2 Whitespace handling
There are two options that affect the whitespace handling:
stripspaces and normalisespaces. The normalisespaces is a simple flag that
controls whether multiple spaces/tabs/newlines are collapsed into
a single space or not. The stripspaces is more complex, it's a bit-mask,
an ORed combination of the following options:
0 - don't remove whitespace around tags
(around tags means before the opening tag and after the closing tag, not in the tag's content!)
1 - remove whitespace before tags whose rules did not return any text content
(the rule specified for the tag caused the data of the tag to be ignored,
processed them already or added them as attributes to parent's \%attr)
2 - remove whitespace around tags whose rules did not return any text content
3 - remove whitespace around all tags
0 - remove only whitespace-only content
(that is remove the whitespace around in this case " "
but not this one "blah blah")
4 - remove trailing/leading whitespace
(remove the whitespace in both cases above)
0 - don't trim content
8 - do trim content
(That is for " blah " only pass to the rule {_content => 'blah'})
That is if you have a data oriented XML in which each tag contains either text
content or subtags, but not both, you want to use
stripspaces => 3 or stripspaces => 3|4. This will not only make sure you don't
need to bother with the whitespace-only _content of the tags with subtags,
but will also make sure you do not keep on wasting memory while parsing a huge
XML and processing the "twigs". Without that option the parent tag of
the repeated tag would keep on accumulating unneeded whitespace in its _content.