|
|
| Keep It Simple, Stupid | |
| PerlMonks |
XML::LibXMLby ForgotPasswordAgain (Deacon) |
| on Jul 11, 2008 at 14:13 UTC ( #696968=note: print w/ replies, xml ) | Need Help?? |
|
XML::LibXML can serialize XML:
use XML::LibXML;
my $parser = XML::LibXML->new();
my $doc = eval { $parser->parse_file($file) };
if ($@) {
print STDERR "Couldn't parse '$file', skipping\n";
} else {
my $dom = $doc->documentElement;
# use DOM methods here
$doc->toFile($file);
}
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||