XML::Parasr style: Tree : SAX « XML « Perl






XML::Parasr style: Tree

  


use XML::Parser;

$parser = new XML::Parser( Style => 'Tree' );
my $tree = $parser->parsefile( shift @ARGV );

# serialize the structure
use Data::Dumper;
print Dumper( $tree );

   
    
  








Related examples in the same category

1.Check error in SAX parser
2.Check node name in SAX paser
3.Register handlers to SAX parser
4.SAX parser handler
5.Converting a comma separated list data source to XML
6.Stream XML::Parser
7.The XML::Parser module provides a framework for parsing XML.
8.Using XML::Parser to parse xml file
9.Using XML:Simple to read and store the document