Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 32.390.915 Times

XML::SAX::Base 1.02

  Date Added: August 05, 2010  |  Visits: 837

XML::SAX::Base

Report Broken Link
Printer Friendly Version


Product Homepage
Download (78 downloads)



XML::SAX::Base is a base Perl class with SAX Drivers and Filters. SYNOPSIS package MyFilter; use XML::SAX::Base; @ISA = (XML::SAX::Base); This module has a very simple task - to be a base class for PerlSAX drivers and filters. Its default behaviour is to pass the input directly to the output unchanged. It can be useful to use this module as a base class so you dont have to, for example, implement the characters() callback. The main advantages that it provides are easy dispatching of events the right way (ie it takes care for you of checking that the handler has implemented that method, or has defined an AUTOLOAD), and the guarantee that filters will pass along events that they arent implementing to handlers downstream that might nevertheless be interested in them. WRITING SAX DRIVERS AND FILTERS Writing SAX Filters is tremendously easy: all you need to do is inherit from this module, and define the events you want to handle. A more detailed explanation can be found at http://www.xml.com/pub/a/2001/10/10/sax-filters.html. Writing Drivers is equally simple. The one thing you need to pay attention to is NOT to call events yourself (this applies to Filters as well). For instance: package MyFilter; use base qw(XML::SAX::Base); sub start_element { my $self = shift; my $data = shift; # do something $self->{Handler}->start_element($data); # BAD } The above example works well as precisely that: an example. But it has several faults: 1) it doesnt test to see whether the handler defines start_element. Perhaps it doesnt want to see that event, in which case you shouldnt throw it (otherwise itll die). 2) it doesnt check ContentHandler and then Handler (ie it doesnt look to see that the user hasnt requested events on a specific handler, and if not on the default one), 3) if it did check all that, not only would the code be cumbersome (see this modules source to get an idea) but it would also probably have to check for a DocumentHandler (in case this were SAX1) and for AUTOLOADs potentially defined in all these packages. As you can tell, that would be fairly painful. Instead of going through that, simply remember to use code similar to the following instead: package MyFilter; use base qw(XML::SAX::Base); sub start_element { my $self = shift; my $data = shift; # do something to filter $self->SUPER::start_element($data); # GOOD (and easy) ! } This way, once youve done your job you hand the ball back to XML::SAX::Base and it takes care of all those problems for you! Note that the above example doesnt apply to filters only, drivers will benefit from the exact same feature..

Requirements: No special requirements
Platforms: Linux
Keyword: Base Base Class Class Drivers Events Filters Handler Libraries Myfilter Programming Sax Sax Drivers Xml Xmlsaxbase
Users rating: 0/10

License: Freeware Size: 20.48 KB
USER REVIEWS
More Reviews or Write Review


XML::SAX::BASE RELATED
Libraries  -  Class::Maker 0.05.18
Class::Maker Perl module contains classes, reflection, schema, serialization, attribute- and multiple inheritance. SYNOPSIS use Class::Maker qw(class); class Human, { isa => [qw( ParentClass )], public => { string => [qw(name lastname)],...
49.15 KB  
Libraries  -  libbsl 0.9.1
libbsl (Basic System Library) is a powerful, easy to use and fully thread safe C++ template class library for frequently recurring (machine/OS oriented) programming problems. All fundamental objects in libbsl are freely copyable and shareable...
1.04 MB  
Education  -  ClaSS 0.9.38
ClaSS (ClaSS Student System) is a complete student tracking, reporting and information management system. The latest web-application methods allow the school community access. ClaSS aims to be the ubiquitous classroom information assistant for school
997.24 KB  
Programming  -  PHP Class Generator Eclipse plug-in 1.0.6
PHP Class Generator Eclipse plug-in creates multiple PHP classes based on an XML template and a MySQL database table. Each generated class represents an access object for one database table, offering getters and setters for each database table field.
1.04 MB  
Development Tools  -  xmlParser for XML Tools 1.1
Class w/examples to provide a method to easily extract data from XML files
10 KB  
Libraries  -  XML::Handler::HTMLWriter 2.01
XML::Handler::HTMLWriter is a SAX Handler for writing HTML 4.0. SYNOPSIS use XML::Handler::HTMLWriter; use XML::SAX; my $writer = XML::Handler::HTMLWriter->new(...); my $parser = XML::SAX::ParserFactory->parser(Handler => $writer); ......
7.17 KB  
Games  -  phpArmory 0.2
phpArmory is a PHP class library that can easily fetch and unserialize World of Warcraft Armory XML data into structured associative arrays. The phpArmoryCache class fully supports both flat files and mysql caching of any and all "fetch" functions.
 
Libraries  -  Tree::Simple::SAX 0.01
Tree::Simple::SAX is a set of classes for using Tree::Simple with XML. SYNOPSIS use Tree::Simple::SAX; use XML::SAX::ParserFactory; my $handler = Tree::Simple::SAX::Handler->new(Tree::Simple->new()); my $p =...
4.1 KB  
Backup Utilities  -  Free PC Driver Backup Utility 2.6.4
Free PC Driver Backup Utility has the ability to create a backup copy of all system drivers and restore them to safeguard your device-related drivers from loss or corruption and save time getting your PC fixed. With this driver backup software,...
3.65 MB  
Productivity  -  Hino Trucks 1.1
Designed and developed with the driver in mind, the Hino Trucks app offers a collection of useful tools for drivers and puts everyday resources at their fingertips. Now drivers can conveniently access the information they need and customers can...
35.3 MB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 3.15.3
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB