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

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

Serving Software Downloads in 956 Categories, Downloaded 49.485.796 Times

XML::SAX::Base 1.02

  Date Added: August 05, 2010  |  Visits: 1.091

XML::SAX::Base

Report Broken Link
Printer Friendly Version


Product Homepage
Download (94 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  -  Object::Transaction 1.01
Object::Transaction is a virtual base class for transactions on files containing serialized hash objects. SYNOPSIS use Object::Transaction; transaction($coderef, @codeargs); commit(); abandon(); $there_is_a_pending_transaction =...
17.41 KB  
Libraries  -  Konstrukt::Handler 0.5 Beta 6
Konstrukt::Handler is a base class for handlers that control the processing of the requests. SYNOPSIS use Konstrukt::Handler; #inherit new(), process() and emergency_exit() use base Konstrukt::Handler; #create handler sub. usually a bit...
522.24 KB  
Libraries  -  C++ base 1.0
C++ base is a base class suite contains several powerful c++ base classes for basic encapsulation of low level operating system calls and basic library functions. Further packages you may access from this page require the installation of this...
102.4 KB  
Libraries  -  Persistent::Base 0.52
Persistent::Base is an Abstract Persistent Base Class. SYNOPSIS ### we are a subclass of ... ### use Persistent::Base; @ISA = qw(Persistent::Base); ABSTRACT This is an abstract class used by the Persistent framework of classes to...
38.91 KB  
Libraries  -  dtRdr::GUI::Wx::Tree::Base 0.0.11
dtRdr::GUI::Wx::Tree::Base is a base class for sidebar trees. SYNOPSIS init $tree->init($frame); select_item Select the tree item for a given $id. $tree->select_item($id) The id is probably the id of whatever your widget associated...
2.8 MB  
Libraries  -  MP3::Find::Base 0.06
MP3::Find::Base is a base class for MP3::Find backends. SYNOPSIS package MyFinder; use base MP3::Find::Base; sub search { my $self = shift; my ($query, $dirs, $sort, $options) = @_; # do something to find and sort the mp3s... my...
29.7 KB  
Libraries  -  Class::Cloneable 0.03
Class::Cloneable is a base class for Cloneable objects. SYNOPSIS package MyObject; our @ISA = (Class::Cloneable); # calling clone on an instance of MyObject # will give you full deep-cloning functionality This module provides a flexible...
8.19 KB  
Libraries  -  Games::LMSolve::Base 0.8.1
Games::LMSolve::Base is a base class for puzzle solvers. SYNOPSIS package MyPuzzle::Solver; use Games::LMSolve::Base; @ISA = qw(Games::LMSolve::Base); # Override these methods: sub input_board { ... } sub pack_state { ... } sub...
21.5 KB  
Libraries  -  Class::StrongSingleton 0.02
Class::StrongSingleton is a stronger and more secure Singleton base class. SYNOPSIS package My::Singleton::Class; use base qw(Class::StrongSingleton); sub new { my ($class, %my_params) = @_; # create our object instance my $instance = {...
6.14 KB  
Miscellaneous  -  A class keeps a reference to it's instance 1.1
This script implements a base class, which allows derived classes to track instances in self.__instances__. It uses a WeakValueDictionary to store instance references.
 
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 4.0.0
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