View on
MetaCPAN
David Helkowski > XML-Bare-SAX-Parser-0.01 > XML::Bare::SAX::Parser

Download:
XML-Bare-SAX-Parser-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

XML::Bare::SAX::Parser

SYNOPSIS ^

  use XML::Simple;
  use Data::Dumper;
  
  $XML::Simple::PREFERRED_PARSER = 'XML::Bare::SAX::Parser';
  
  my $ref = XMLin("<xml><namea blah=1>bob</namea><nameb>testsfs</nameb></xml>");
  
  print Dumper( $ref );

DESCRIPTION ^

This module uses the 'Bare XML' parser from XML::Bare to generate Perl SAX calls. The parser itself is minimalistic and is a simle state engine written in ~500 lines of C.

Supported XML

The XML parser used in the module can parse standard XML cleanly. Note that is very accepting in its parsing and will continue parsing regardless of whether the XML you feed it is valid or not.

Parsing Limitations / Features

Module Functions

Functions Used Internally

Performance

In comparison to other SAX parsers, XML::Bare::SAX::Parser is extremely fast. It runs nearly 10 times faser than the other Perl SAX Parsers available. It does so by only generating calls for a basic set of XML features.

See XML::Bare POD for some example benchmarks of XML::Simple run with this parser in comparison to other tree parsers including XML::Bare.

Apologetics

The feature set of the parser make it optimal for use with XML::Simple.

If you like the parser in XML::Bare but prefer using XML::Simple and the structure it generates then this module is for you.

Note that the author of XML::Simple has expressed fairly strong dissaproval of the lax parsing of XML::Bare and probably would not reccomend using his module in combination with XML::Bare::SAX::Parser. That said, it is a free country, and all mentioned modules are open source. Hurray for the freedom to choose and the ability to get more speed out of the the modules you like.

If you like this module, please reccomend it to others. If you have problems with it, please let me know what issues you have and I will attempt to resolve them.

If you have gripes about the module not parsing according to the official XML specifications, you should switch to using a different SAX parser.

LICENSE ^

  Copyright (C) 2007 David Helkowski
  
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License as
  published by the Free Software Foundation; either version 2 of the
  License, or (at your option) any later version.  You may also can
  redistribute it and/or modify it under the terms of the Perl
  Artistic License.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
syntax highlighting: