in reply to compacting XML?
The other kitchen sink, XML::LibXML.
use strict; use warnings; use XML::LibXML qw( ); my $xml = <<'XML'; <outermost> <innermost> <first>1</first> <second/> <third>These spaces are to be preserved.</third> </innermost> </outermost> XML my $doc = XML::LibXML->load_xml( string => $xml, no_blanks => 1 ); print $doc->toString();
|
|---|