I'm too lazy right now to do it with XML::Simple, but here's one I wrote a while ago to do it with XML::Parser. I wrote it to check that some XML I was writing was valid and wouldn't make the parser barf.
#!/usr/bin/perl use strict; use warnings; use XML::Parser; $parser = new XML::Parser( Style => 'Tree' ); my $tree = $parser->parsefile( shift @ARGV ); use Data::Dumper; print Dumper( $tree );
ADDENDUM: I usually don't bother with putting a file open/write in something this short, I just use > filename.xml
In reply to Re: perl xml parsing
by bitingduck
in thread perl xml parsing
by poper12
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |