xml parser perl module
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 8044
MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. more>>
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS.
MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images).
MN::CMS is a perl module that allows you to manage an Internet
publishing system.#
MyCMS is an extension module of MyNews.
MyCMS introduces the concept of article, author and moderator.
<<lessMyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images).
MN::CMS is a perl module that allows you to manage an Internet
publishing system.#
MyCMS is an extension module of MyNews.
MyCMS introduces the concept of article, author and moderator.
Download (0.016MB)
Added: 2007-02-13 License: Perl Artistic License Price:
986 downloads
OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius. more>>
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius.
<<less Download (0.003MB)
Added: 2007-03-01 License: Perl Artistic License Price:
968 downloads
XML::Parser::PerlSAX 0.08
XML::Parser::PerlSAX is a Perl SAX parser using XML::Parser. more>>
XML::Parser::PerlSAX is a Perl SAX parser using XML::Parser.
SYNOPSIS
use XML::Parser::PerlSAX;
$parser = XML::Parser::PerlSAX->new( [OPTIONS] );
$result = $parser->parse( [OPTIONS] );
$result = $parser->parse($string);
XML::Parser::PerlSAX is a PerlSAX parser using the XML::Parser module. This man page summarizes the specific options, handlers, and properties supported by XML::Parser::PerlSAX; please refer to the PerlSAX standard in `PerlSAX.pod for general usage information.
METHODS
new
Creates a new parser object. Default options for parsing, described below, are passed as key-value pairs or as a single hash. Options may be changed directly in the parser object unless stated otherwise. Options passed to `parse() override the default options in the parser object for the duration of the parse.
parse
Parses a document. Options, described below, are passed as key-value pairs or as a single hash. Options passed to `parse() override default options in the parser object.
location
Returns the location as a hash:
ColumnNumber The column number of the parse.
LineNumber The line number of the parse.
BytePosition The current byte position of the parse.
PublicId A string containing the public identifier, or undef
if none is available.
SystemId A string containing the system identifier, or undef
if none is available.
Base The current value of the base for resolving relative
URIs.
ALPHA WARNING: The `SystemId and `PublicId properties returned are the system and public identifiers of the document passed to `parse(), not the identifiers of the currently parsing external entity. The column, line, and byte positions are of the current entity being parsed.
<<lessSYNOPSIS
use XML::Parser::PerlSAX;
$parser = XML::Parser::PerlSAX->new( [OPTIONS] );
$result = $parser->parse( [OPTIONS] );
$result = $parser->parse($string);
XML::Parser::PerlSAX is a PerlSAX parser using the XML::Parser module. This man page summarizes the specific options, handlers, and properties supported by XML::Parser::PerlSAX; please refer to the PerlSAX standard in `PerlSAX.pod for general usage information.
METHODS
new
Creates a new parser object. Default options for parsing, described below, are passed as key-value pairs or as a single hash. Options may be changed directly in the parser object unless stated otherwise. Options passed to `parse() override the default options in the parser object for the duration of the parse.
parse
Parses a document. Options, described below, are passed as key-value pairs or as a single hash. Options passed to `parse() override default options in the parser object.
location
Returns the location as a hash:
ColumnNumber The column number of the parse.
LineNumber The line number of the parse.
BytePosition The current byte position of the parse.
PublicId A string containing the public identifier, or undef
if none is available.
SystemId A string containing the system identifier, or undef
if none is available.
Base The current value of the base for resolving relative
URIs.
ALPHA WARNING: The `SystemId and `PublicId properties returned are the system and public identifiers of the document passed to `parse(), not the identifiers of the currently parsing external entity. The column, line, and byte positions are of the current entity being parsed.
Download (0.063MB)
Added: 2006-06-14 License: GPL (GNU General Public License) Price:
1234 downloads
Image::Density Perl Module 0.2
The metric implemented in the Image::Density Perl Module estimates the density of data where there is data. more>>
The metric implemented in the Image::Density Perl Module estimates the density of data where there is data, and has a reasonable correlation with goodness as judged by humans.
That is, if you let a human look at a set of images and judge quality, the density values for those images as calculated here tend to correlate well with the human judgement (densities that are too high or too low represent "bad images).
This project is intended for use on bitonal TIFF images, such as those from scanning paper documents.
<<lessThat is, if you let a human look at a set of images and judge quality, the density values for those images as calculated here tend to correlate well with the human judgement (densities that are too high or too low represent "bad images).
This project is intended for use on bitonal TIFF images, such as those from scanning paper documents.
Download (0.63MB)
Added: 2007-05-15 License: Perl Artistic License Price:
892 downloads
XML::Parser 2.34
XML::Parser is a perl module for parsing XML documents. more>>
XML::Parser is a perl module for parsing XML documents.
SYNOPSIS
use XML::Parser;
$p1 = new XML::Parser(Style => Debug);
$p1->parsefile(REC-xml-19980210.xml);
$p1->parse( Hello World );
# Alternative
$p2 = new XML::Parser(Handlers => {Start => &handle_start,
End => &handle_end,
Char => &handle_char});
$p2->parse($socket);
# Another alternative
$p3 = new XML::Parser(ErrorContext => 2);
$p3->setHandlers(Char => &text,
Default => &other);
open(FOO, xmlgenerator |);
$p3->parse(*FOO, ProtocolEncoding => ISO-8859-1);
close(FOO);
$p3->parsefile(junk.xml, ErrorContext => 3);
This module provides ways to parse XML documents. It is built on top of XML::Parser::Expat, which is a lower level interface to James Clarks expat library. Each call to one of the parsing methods creates a new instance of XML::Parser::Expat which is then used to parse the document.
Expat options may be provided when the XML::Parser object is created. These options are then passed on to the Expat object on each parse call. They can also be given as extra arguments to the parse methods, in which case they override options given at XML::Parser creation time.
The behavior of the parser is controlled either by "Style" and/or "Handlers" options, or by "setHandlers" method. These all provide mechanisms for XML::Parser to set the handlers needed by XML::Parser::Expat. If neither Style nor Handlers are specified, then parsing just checks the document for being well-formed.
When underlying handlers get called, they receive as their first parameter the Expat object, not the Parser object.
<<lessSYNOPSIS
use XML::Parser;
$p1 = new XML::Parser(Style => Debug);
$p1->parsefile(REC-xml-19980210.xml);
$p1->parse( Hello World );
# Alternative
$p2 = new XML::Parser(Handlers => {Start => &handle_start,
End => &handle_end,
Char => &handle_char});
$p2->parse($socket);
# Another alternative
$p3 = new XML::Parser(ErrorContext => 2);
$p3->setHandlers(Char => &text,
Default => &other);
open(FOO, xmlgenerator |);
$p3->parse(*FOO, ProtocolEncoding => ISO-8859-1);
close(FOO);
$p3->parsefile(junk.xml, ErrorContext => 3);
This module provides ways to parse XML documents. It is built on top of XML::Parser::Expat, which is a lower level interface to James Clarks expat library. Each call to one of the parsing methods creates a new instance of XML::Parser::Expat which is then used to parse the document.
Expat options may be provided when the XML::Parser object is created. These options are then passed on to the Expat object on each parse call. They can also be given as extra arguments to the parse methods, in which case they override options given at XML::Parser creation time.
The behavior of the parser is controlled either by "Style" and/or "Handlers" options, or by "setHandlers" method. These all provide mechanisms for XML::Parser to set the handlers needed by XML::Parser::Expat. If neither Style nor Handlers are specified, then parsing just checks the document for being well-formed.
When underlying handlers get called, they receive as their first parameter the Expat object, not the Parser object.
Download (0.22MB)
Added: 2006-06-14 License: Perl Artistic License Price:
1235 downloads
XML::Parser::EasyTree 0.01
XML::Parser::EasyTree is an easier tree style for XML::Parser. more>>
XML::Parser::EasyTree is an easier tree style for XML::Parser.
SYNOPSIS
use XML::Parser;
use XML::Parser::EasyTree;
$XML::Parser::Easytree::Noempty=1;
my $p=new XML::Parser(Style=>EasyTree);
my $tree=$p->parsefile(something.xml);
XML::Parser::EasyTree adds a new "built-in" style called "EasyTree" to XML::Parser. Like XML::Parsers "Tree" style, setting this style causes the parser to build a lightweight tree structure representing the XML document. This structure is, at least in this authors opinion, easier to work with than the one created by the built-in style.
When the parser is invoked with the EasyTree style, it returns a reference to an array of tree nodes, each of which is a hash reference.
All nodes have a type key whose value is the type of the node: e for element nodes, t for text nodes, and p for processing instruction nodes. All nodes also have a content key whose value is a reference to an array holding the elements child nodes for element nodes, the string value for text nodes, and the data value for processing instruction nodes. Element nodes also have an attrib key whose value is a reference to a hash of attribute names and values. Processing instructions also have a target key whose value is the PIs target.
EasyTree nodes are ordinary Perl hashes and are not objects. Contiguous runs of text are always returned in a single node.
The reason the parser returns an array reference rather than the root elements node is that an XML document can legally contain processing instructions outside the root element (the xml-stylesheet PI is commonly used this way).
If the parsers Namespaces option is set, element and attribute names will be prefixed with their (possibly empty) namespace URI enclosed in curly brackets.
<<lessSYNOPSIS
use XML::Parser;
use XML::Parser::EasyTree;
$XML::Parser::Easytree::Noempty=1;
my $p=new XML::Parser(Style=>EasyTree);
my $tree=$p->parsefile(something.xml);
XML::Parser::EasyTree adds a new "built-in" style called "EasyTree" to XML::Parser. Like XML::Parsers "Tree" style, setting this style causes the parser to build a lightweight tree structure representing the XML document. This structure is, at least in this authors opinion, easier to work with than the one created by the built-in style.
When the parser is invoked with the EasyTree style, it returns a reference to an array of tree nodes, each of which is a hash reference.
All nodes have a type key whose value is the type of the node: e for element nodes, t for text nodes, and p for processing instruction nodes. All nodes also have a content key whose value is a reference to an array holding the elements child nodes for element nodes, the string value for text nodes, and the data value for processing instruction nodes. Element nodes also have an attrib key whose value is a reference to a hash of attribute names and values. Processing instructions also have a target key whose value is the PIs target.
EasyTree nodes are ordinary Perl hashes and are not objects. Contiguous runs of text are always returned in a single node.
The reason the parser returns an array reference rather than the root elements node is that an XML document can legally contain processing instructions outside the root element (the xml-stylesheet PI is commonly used this way).
If the parsers Namespaces option is set, element and attribute names will be prefixed with their (possibly empty) namespace URI enclosed in curly brackets.
Download (0.003MB)
Added: 2006-06-14 License: Perl Artistic License Price:
1228 downloads
XML::RSS::Parser 4.0
XML::RSS::Parser is a liberal object-oriented parser for RSS feeds. more>>
XML::RSS::Parser is a liberal object-oriented parser for RSS feeds.
SYNOPSIS
#!/usr/bin/perl -w
use strict;
use XML::RSS::Parser;
use FileHandle;
my $p = XML::RSS::Parser->new;
my $fh = FileHandle->new(/path/to/some/rss/file);
my $feed = $p->parse_file($fh);
# output some values
my $feed_title = $feed->query(/channel/title);
print $feed_title->text_content;
my $count = $feed->item_count;
print " ($count)n";
foreach my $i ( $feed->query(//item) ) {
my $node = $i->query(title);
print .$node->text_content;
print "n";
}
XML::RSS::Parser is a lightweight liberal parser of RSS feeds. This parser is "liberal" in that it does not demand compliance of a specific RSS version and will attempt to gracefully handle tags it does not expect or understand. The parsers only requirements is that the file is well-formed XML and remotely resembles RSS. Roughly speaking, well formed XML with a channel element as a direct sibling or the root tag and item elements etc.
There are a number of advantages to using this module then just using a standard parser-tree combination. There are a number of different RSS formats in use today. In very subtle ways these formats are not entirely compatible from one to another. XML::RSS::Parser makes a couple assumptions to "normalize" the parse tree into a more consistent form. For instance, it forces channel and item into a parent-child relationship. For more detail see "SPECIAL PROCESSING NOTES".
This module is leaner then XML::RSS -- the majority of code was for generating RSS files. It also provides a XPath-esque interface to the feeds tree.
While XML::RSS::Parser creates a normalized parse tree, it still leaves the mapping of overlapping and alternate tags common in the RSS format space to the developer. For this look at the XML::RAI (RSS Abstraction Interface) package which provides an object-oriented layer to XML::RSS::Parser trees that transparently maps these various tags to one common interface.
XML::RSS::Parser is based on XML::Elemental, a a SAX-based package for easily parsing XML documents into a more native and mostly object-oriented perl form.
<<lessSYNOPSIS
#!/usr/bin/perl -w
use strict;
use XML::RSS::Parser;
use FileHandle;
my $p = XML::RSS::Parser->new;
my $fh = FileHandle->new(/path/to/some/rss/file);
my $feed = $p->parse_file($fh);
# output some values
my $feed_title = $feed->query(/channel/title);
print $feed_title->text_content;
my $count = $feed->item_count;
print " ($count)n";
foreach my $i ( $feed->query(//item) ) {
my $node = $i->query(title);
print .$node->text_content;
print "n";
}
XML::RSS::Parser is a lightweight liberal parser of RSS feeds. This parser is "liberal" in that it does not demand compliance of a specific RSS version and will attempt to gracefully handle tags it does not expect or understand. The parsers only requirements is that the file is well-formed XML and remotely resembles RSS. Roughly speaking, well formed XML with a channel element as a direct sibling or the root tag and item elements etc.
There are a number of advantages to using this module then just using a standard parser-tree combination. There are a number of different RSS formats in use today. In very subtle ways these formats are not entirely compatible from one to another. XML::RSS::Parser makes a couple assumptions to "normalize" the parse tree into a more consistent form. For instance, it forces channel and item into a parent-child relationship. For more detail see "SPECIAL PROCESSING NOTES".
This module is leaner then XML::RSS -- the majority of code was for generating RSS files. It also provides a XPath-esque interface to the feeds tree.
While XML::RSS::Parser creates a normalized parse tree, it still leaves the mapping of overlapping and alternate tags common in the RSS format space to the developer. For this look at the XML::RAI (RSS Abstraction Interface) package which provides an object-oriented layer to XML::RSS::Parser trees that transparently maps these various tags to one common interface.
XML::RSS::Parser is based on XML::Elemental, a a SAX-based package for easily parsing XML documents into a more native and mostly object-oriented perl form.
Download (0.012MB)
Added: 2006-12-21 License: Perl Artistic License Price:
1038 downloads
XML::Parser::YahooRESTGeocode 0.1
XML::Parser::YahooRESTGeocode is an XML::Parser subclass for parsing results returned from YAHOO REST geocode webservice. more>>
SYNOPPSIS
use LWP::Simple
use XML::Parser;
use XML::Parser::YahooRESTGeocode;
#connect to yahoo geocode service
my $url = http://api.local.yahoo.com/MapsService/V1/geocode;
my $get = appid=YahooDemo&street=701+First+Street&city=Sunnyvale&state=CA;
#call yahoo geocode service
my $xml = get $url . "?" . $get;
#construct use XML::Parser with YahooRESTGeocode subclass
my $parser = new XML::Parser(Style => YahooRESTGeocode);
my $data = $parser->parse($xml) || do {
die ("parse failed: $XML::Parser::errstr, $!n");
};
#use the data for something
my $cnt = 0;
foreach my $result (@{$data->{Result}}){
$cnt ++;
print "n---- RESULT #" . $cnt . " ----n";
foreach my $field (keys %{$result}){
print "t[" . $field . "]: " . $result->{$field} . "n";
}
}
NOTES
works for geocode only
this module only knows how to handle Yahoo!s REST responses from the geocode API
known fields
this module will need to be modified if more fields are added to the node, namely, their names will need to be added to the %node_tree hash at the top of the module
this was a quick hack
hey, maybe theres a better module for parsing REST query responses out there? This module was written as a quick hack, not as a one stop solution. If you want to add improvements or what have you, then please feel free to hack away on this till youre blue in the face. Send me the changes though, so I can put em in the distribution.
make test dosent really test anything
well ... its a quick hack. part of writing a quick hack is not writing proper test cases and skimping on documentation, speaking of ... why am I still writing ???
thanks to Yahoo!
Hey, Yahoo! Thanks for your geocode API, its pretty sweet!
Download (0.004MB)
Added: 2006-06-14 License: Perl Artistic License Price:
1227 downloads
XML::LibXML::Parser 1.63
XML::LibXML::Parser is a Perl module to parse XML Data with XML::LibXML. more>>
XML::LibXML::Parser is a Perl module to parse XML Data with XML::LibXML.
SYNOPSIS
$parser = XML::LibXML->new();
$doc = $parser->parse_file( $xmlfilename );
$doc = $parser->parse_fh( $io_fh );
$doc = $parser->parse_string( $xmlstring);
$doc = $parser->parse_html_file( $htmlfile, %opts );
$doc = $parser->parse_html_fh( $io_fh, %opts );
$doc = $parser->parse_html_string( $htmlstring, %opts );
$fragment = $parser->parse_balanced_chunk( $wbxmlstring );
$fragment = $parser->parse_xml_chunk( $wbxmlstring );
$parser->process_xincludes( $doc );
$parser->processXIncludes( $doc );
$parser->parse_chunk($string, $terminate);
$parser->start_push();
$parser->push(@data);
$doc = $parser->finish_push( $recover );
$parser->validation(1);
$parser->recover(1);
$parser->recover_silently(1);
$parser->expand_entities(0);
$parser->keep_blanks(0);
$parser->pedantic_parser(1);
$parser->line_numbers(1);
$parser->load_ext_dtd(1);
$parser->complete_attributes(1);
$parser->expand_xinclude(1);
$parser->load_catalog( $catalog_file );
$parser->base_uri( $your_base_uri );
$parser->gdome_dom(1);
$parser->clean_namespaces( 1 );
$parser->no_network(1);
SYNOPSIS
use XML::LibXML;
my $parser = XML::LibXML->new();
my $doc = $parser->parse_string(parse_fh( $xmlstream );
my $fragment = $parser->parse_xml_chunk( $xml_wb_chunk );
<<lessSYNOPSIS
$parser = XML::LibXML->new();
$doc = $parser->parse_file( $xmlfilename );
$doc = $parser->parse_fh( $io_fh );
$doc = $parser->parse_string( $xmlstring);
$doc = $parser->parse_html_file( $htmlfile, %opts );
$doc = $parser->parse_html_fh( $io_fh, %opts );
$doc = $parser->parse_html_string( $htmlstring, %opts );
$fragment = $parser->parse_balanced_chunk( $wbxmlstring );
$fragment = $parser->parse_xml_chunk( $wbxmlstring );
$parser->process_xincludes( $doc );
$parser->processXIncludes( $doc );
$parser->parse_chunk($string, $terminate);
$parser->start_push();
$parser->push(@data);
$doc = $parser->finish_push( $recover );
$parser->validation(1);
$parser->recover(1);
$parser->recover_silently(1);
$parser->expand_entities(0);
$parser->keep_blanks(0);
$parser->pedantic_parser(1);
$parser->line_numbers(1);
$parser->load_ext_dtd(1);
$parser->complete_attributes(1);
$parser->expand_xinclude(1);
$parser->load_catalog( $catalog_file );
$parser->base_uri( $your_base_uri );
$parser->gdome_dom(1);
$parser->clean_namespaces( 1 );
$parser->no_network(1);
SYNOPSIS
use XML::LibXML;
my $parser = XML::LibXML->new();
my $doc = $parser->parse_string(parse_fh( $xmlstream );
my $fragment = $parser->parse_xml_chunk( $xml_wb_chunk );
Download (0.25MB)
Added: 2007-06-15 License: Perl Artistic License Price:
863 downloads
XML::SAX2Perl 0.08
XML::SAX2Perl is a Perl module to translate Perl SAX methods to Java/CORBA style methods. more>>
XML::SAX2Perl is a Perl module to translate Perl SAX methods to Java/CORBA style methods.
SYNOPSIS
use XML::Perl2SAX;
$perl2sax = XML::Perl2SAX(handler => $java_style_handler);
XML::Perl2SAX is a SAX filter that translates Perl style SAX methods to Java/CORBA style method calls. This module performs the inverse operation from XML::SAX2Perl.
Perl2SAX is a Perl SAX document handler. The `new method takes a `handler argument that is a Java/CORBA style handler that the new Perl2SAX instance will call. The SAX interfaces are defined at < http://www.megginson.com/SAX/ >.
<<lessSYNOPSIS
use XML::Perl2SAX;
$perl2sax = XML::Perl2SAX(handler => $java_style_handler);
XML::Perl2SAX is a SAX filter that translates Perl style SAX methods to Java/CORBA style method calls. This module performs the inverse operation from XML::SAX2Perl.
Perl2SAX is a Perl SAX document handler. The `new method takes a `handler argument that is a Java/CORBA style handler that the new Perl2SAX instance will call. The SAX interfaces are defined at < http://www.megginson.com/SAX/ >.
Download (0.063MB)
Added: 2007-06-05 License: Perl Artistic License Price:
871 downloads
Simple Plain Xml Parser 0.4
Simple Plain Xml Parser is a simple and plain xml parser written in C++. more>>
Simple Plain Xml Parser (spxml) is a simple and plain xml parser written in C++. spxml supports pull-model and DOM-model xml parsing.
spxml is a stream-oriented parser. As the user passes it chunks of the input XML document, spxml identifies elements, character data or other entities and return the appropriate event. The size of the chunks is controlled by the user; chunks can range from one byte to the whole XML document.
spxml pull parser does not need to be told when the document is ended. On the contrary, spxml pull parser will tell us when it has finished parsing a root ( or other ) element. spxml pull parser can therefore safely read from pipes, can process sequences of XML documents without extra delimiters, and can handle selected parts of a document.
spxml DOM parser parses an XML document, and builds a DOM tree that can be read, modified, and saved.
Enhancements:
- This release adds UTF-8 encoding and processing instruction support.
<<lessspxml is a stream-oriented parser. As the user passes it chunks of the input XML document, spxml identifies elements, character data or other entities and return the appropriate event. The size of the chunks is controlled by the user; chunks can range from one byte to the whole XML document.
spxml pull parser does not need to be told when the document is ended. On the contrary, spxml pull parser will tell us when it has finished parsing a root ( or other ) element. spxml pull parser can therefore safely read from pipes, can process sequences of XML documents without extra delimiters, and can handle selected parts of a document.
spxml DOM parser parses an XML document, and builds a DOM tree that can be read, modified, and saved.
Enhancements:
- This release adds UTF-8 encoding and processing instruction support.
Download (0.023MB)
Added: 2007-07-22 License: GPL (GNU General Public License) Price:
825 downloads
XML::Checker::Parser 1.02
XML::Checker::Parser is an XML::Parser that validates at parse time. more>>
XML::Checker::Parser is an XML::Parser that validates at parse time.
SYNOPSIS
use XML::Checker::Parser;
my %expat_options = (KeepCDATA => 1,
Handlers => [ Unparsed => &my_Unparsed_handler ]);
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.
# Dont 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::Parser
I 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 );
<<lessSYNOPSIS
use XML::Checker::Parser;
my %expat_options = (KeepCDATA => 1,
Handlers => [ Unparsed => &my_Unparsed_handler ]);
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.
# Dont 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::Parser
I 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 );
Download (0.36MB)
Added: 2006-06-15 License: Perl Artistic License Price:
1226 downloads
PXR::Parser 0.1.5
PXR::Parser is a Pure Perl SAX XML Push Parser. more>>
PXR::Parser is a Pure Perl SAX XML Push Parser.
SYNOPSIS
use PXR::Parser;
my $parser = PXR::Parser->new(
Handlers => {
startDocument => &start_doc,
endDocument => &end_doc,
startElement => &start_element,
endElement => &end_element,
characters => &characters,
}
);
$parser->parse($data);
$parser->setHandlers(startDocument => &different_start);
A simple, fast, efficient pure perl sax xml parser.
BUGS AND NOTES
This Parser was blatantly ripped and modified from XML::Stream::Parser because it was the only pure perl parser simple and speedy enough to be included by default in various other things such as PXR or PoCo::Jabber. Just note that there is no recovering or detecting XML malformedness. So if you feed this little pet something non-tasty, you are in for a surprise (mainly memory leaking everywhere, and other things like gnawing on furniture).
That is the trade off for its speed. In situtations where you know you are not going to get malformed XML such as a connection to a jabber server (or other XML pushing entities) then this parser is ideal. Currently, the speed difference between this parser and XML::Parser::Expat are about 30 percent in favor of XML::Parser::Expat (which says alot of the speed of this pure perl implementation).
Thanks to Ryan Eatmon for writing and releasing this code. It has been a boon to those of us that really appreciate a simple small solution.
<<lessSYNOPSIS
use PXR::Parser;
my $parser = PXR::Parser->new(
Handlers => {
startDocument => &start_doc,
endDocument => &end_doc,
startElement => &start_element,
endElement => &end_element,
characters => &characters,
}
);
$parser->parse($data);
$parser->setHandlers(startDocument => &different_start);
A simple, fast, efficient pure perl sax xml parser.
BUGS AND NOTES
This Parser was blatantly ripped and modified from XML::Stream::Parser because it was the only pure perl parser simple and speedy enough to be included by default in various other things such as PXR or PoCo::Jabber. Just note that there is no recovering or detecting XML malformedness. So if you feed this little pet something non-tasty, you are in for a surprise (mainly memory leaking everywhere, and other things like gnawing on furniture).
That is the trade off for its speed. In situtations where you know you are not going to get malformed XML such as a connection to a jabber server (or other XML pushing entities) then this parser is ideal. Currently, the speed difference between this parser and XML::Parser::Expat are about 30 percent in favor of XML::Parser::Expat (which says alot of the speed of this pure perl implementation).
Thanks to Ryan Eatmon for writing and releasing this code. It has been a boon to those of us that really appreciate a simple small solution.
Download (0.016MB)
Added: 2006-09-18 License: Perl Artistic License Price:
1131 downloads
Shell::Parser 0.04
Shell::Parser is a simple shell script parser. more>>
Shell::Parser is a simple shell script parser.
SYNOPSIS
use Shell::Parser;
my $parser = new Shell::Parser syntax => bash, handlers => {
};
$parser->parse(...);
$parser->eof;
This module implements a rudimentary shell script parser in Perl. It was primarily written as a backend for Syntax::Highlight::Shell, in order to simplify the creation of the later.
<<lessSYNOPSIS
use Shell::Parser;
my $parser = new Shell::Parser syntax => bash, handlers => {
};
$parser->parse(...);
$parser->eof;
This module implements a rudimentary shell script parser in Perl. It was primarily written as a backend for Syntax::Highlight::Shell, in order to simplify the creation of the later.
Download (0.017MB)
Added: 2007-04-06 License: Perl Artistic License Price:
934 downloads
iCal::Parser::HTML 1.06
iCal::Parser::HTML is a Perl module to generate HTML calendars from iCalendars. more>>
iCal::Parser::HTML is a Perl module to generate HTML calendars from iCalendars.
SYNOPSIS
use iCal::Parser::HTML;
my $parser=iCal::Parser::HTML->new;
print $parser->parse(type=>$type,start=>$date,files=>[@icals]);
This module uses iCal::Parser::SAX and XML::LibXSLT with included stylesheets to generates html calendars from icalendars.
The html document generated includes (when appropriate) a sidebar containing a legend, a list of todos and a three month calendar for the previous, current and next months.
The stylesheets are stored in the HTML/stylesheet directory under the installed package directory.
Also included in this package are an optionally installed command line program "ical2html" in scripts and, in the example directory, a cgi handler ("ical.cgi" in examples) and a stylesheet ("calendar.css" in examples) for formatting the html output. Note that the html output will look quite broken without the stylesheet.
<<lessSYNOPSIS
use iCal::Parser::HTML;
my $parser=iCal::Parser::HTML->new;
print $parser->parse(type=>$type,start=>$date,files=>[@icals]);
This module uses iCal::Parser::SAX and XML::LibXSLT with included stylesheets to generates html calendars from icalendars.
The html document generated includes (when appropriate) a sidebar containing a legend, a list of todos and a three month calendar for the previous, current and next months.
The stylesheets are stored in the HTML/stylesheet directory under the installed package directory.
Also included in this package are an optionally installed command line program "ical2html" in scripts and, in the example directory, a cgi handler ("ical.cgi" in examples) and a stylesheet ("calendar.css" in examples) for formatting the html output. Note that the html output will look quite broken without the stylesheet.
Download (0.049MB)
Added: 2007-04-07 License: Perl Artistic License Price:
930 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above xml parser perl module search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed