hello ateague.
Sometimes I met the case when pretty print doesn't work with XML::Twig. If pretty print is the problem, how about this?
This prints pretty with my XML::TwigXML::Twig->new( twig_handlers => { 'statement' => sub { my($twig,$elt)=@_; if( $elt->find_nodes('primary/acct', 0)->trimmed_text() eq + '903264' ){ $twig->flush; }else { $twig->purge; } }, 'statement//*' =>sub {}, #skip descendants of statement '_default_' => sub { #just flush my($twig,$elt)=@_; $twig->flush; } }, #twig_print_outside_roots =>1, pretty_print => 'indented', )->parse(*DATA); __DATA__ same data
This example be "potato", becuase it kills the advantage to use twig_root.C:\temp>perl -MXML::Twig -e "print $XML::Twig::VERSION" 3.42
In reply to Re: XML::Twig's twig_print_outside_roots adds extra blank lines to output
by remiah
in thread [SOLVED] XML::Twig's twig_print_outside_roots adds extra blank lines to output
by ateague
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |