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 29.858.691 Times

XML::SAX::Base 1.02

  Date Added: August 05, 2010  |  Visits: 799

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.
 
Programming  -  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...
2.6 MB  
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  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.11.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...
2.73 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