XML::Checker::Parser

XML::Checker::Parser is an XML::Parser that validates at parse time.
Download

XML::Checker::Parser Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Enno Derksen
  • Publisher web site:
  • http://search.cpan.org/~tjmather/XML-UM-0.01/UM.pm

XML::Checker::Parser Tags


XML::Checker::Parser Description

XML::Checker::Parser is an XML::Parser that validates at parse time. XML::Checker::Parser is an XML::Parser that validates at parse time.SYNOPSIS use XML::Checker::Parser; my %expat_options = (KeepCDATA => 1, Handlers => ); my $parser = new XML::Checker::Parser (%expat_options); eval { local $XML::Checker::FAIL = &my_fail; $parser->parsefile ("fail.xml"); }; if ($@) { # Either XML::Parser (expat) threw an exception or my_fail() died. ... your error handling code here ... } # Throws an exception (with die) when an error is encountered, this # will stop the parsing process. # Don't die if a warning or info message is encountered, just print a message. sub my_fail { my $code = shift; die XML::Checker::error_string ($code, @_) if $code < 200; XML::Checker::print_error ($code, @_); }XML::Checker::Parser extends XML::ParserI hope the example in the SYNOPSIS says it all, just use XML::Checker::Parser as if it were an XML::Parser. See XML::Parser for the supported (expat) options.You can also derive your parser from XML::Checker::Parser instead of from XML::Parser. All you should have to do is replace: package MyParser; @ISA = qw( XML::Parser );with: package MyParser; @ISA = qw( XML::Checker::Parser ); Requirements: · Perl


XML::Checker::Parser Related Software