NAME
XML::Dumper - Perl module for dumping Perl objects into XML
SYNOPSIS
use XML::Parser;
use XML::Dumper;
# create a new XML::Parser instance using Tree Style
$parser = new XML::Parser (Style => 'Tree');
# create new instance of XML::Dumper
$dump = new XML::Dumper;
# Convert XML to Perl code
$tree = $parser->parsefile($file);
$tree = $parser->parse('<foo id="me">Hello World</foo>');
# print the results
print $dump->xml2pl($tree);
# Convert Perl code to XML
# read file in Data::Dumper format
open(PL,$file) || die "Cannot open $file: $!";
$perl = eval(join("",<PL>));
# print the results
print $dump->pl2xml($perl);
DESCRIPTION
XML::Dumper can dump an XML file to Perl code using Data::Dumper, or dump Perl code into XML.
This is done via the following 2 methods: XML::Dumper::xml2pl XML::Dumper::pl2xml
This module was originally intended for an article I wrote for TPJ, but I wasn't able to work it in; but maybe you'll find it useful.
Currently, you can only dump array and hashes. I plan on adding the ability to dump more complex objects in the future.
AUTHOR
Jonathan Eisenzopf, eisen@pobox.com
SEE ALSO
perl(1), XML::Parser(3).