hi, is it possible to remove linefeed, cr or tab from XML elements' content automatically using Twig, rather than using RE as it is quite slow for large document. i don't know if `expat` provided this function already or not.
i.e.
use XML::Twig;
my $xml = qq{ <people>
<name>tom</name>
<description>test
123
2
2</description>
</people>
};
my $twig= new XML::Twig(
discard_spaces_in => ['description'],
TwigHandlers =>
{ people => \&people }
);
$twig->parse($xml);
sub people {
my( $twig, $people)= @_;
print $people->first_child( 'description')->text; # i don't want \n\r\t !
}
Thanks.