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

XML::SAX::Intro 0.14

  Date Added: March 16, 2010  |  Visits: 878

XML::SAX::Intro

Report Broken Link
Printer Friendly Version


Product Homepage
Download (101 downloads)



XML::SAX::Intro is an Introduction to SAX Parsing with Perl. XML::SAX is a new way to work with XML Parsers in Perl. In this article well discuss why you should be using SAX, why you should be using XML::SAX, and well see some of the finer implementation details. The text below assumes some familiarity with callback, or push based parsing, but if you are unfamiliar with these techniques then a good place to start is Kip Hamptons excellent series of articles on XML.com. Replacing XML::Parser The de-facto way of parsing XML under perl is to use Larry Wall and Clark Coopers XML::Parser. This module is a Perl and XS wrapper around the expat XML parser library by James Clark. It has been a hugely successful project, but suffers from a couple of rather major flaws. Firstly it is a proprietary API, designed before the SAX API was conceived, which means that it is not easily replaceable by other streaming parsers. Secondly its callbacks are subrefs. This doesnt sound like much of an issue, but unfortunately leads to code like: sub handle_start { my ($e, $el, %attrs) = @_; if ($el eq foo) { $e->{inside_foo}++; # BAD! $e is an XML::Parser::Expat object. } } As you can see, were using the $e object to hold our state information, which is a bad idea because we dont own that object - we didnt create it. Its an internal object of XML::Parser, that happens to be a hashref. We could all too easily overwrite XML::Parser internal state variables by using this, or Clark could change it to an array ref (not that he would, because it would break so much code, but he could). The only way currently with XML::Parser to safely maintain state is to use a closure: my $state = MyState->new(); $parser->setHandlers(Start => sub { handle_start($state, @_) }); This closure traps the $state variable, which now gets passed as the first parameter to your callback. Unfortunately very few people use this technique, as it is not documented in the XML::Parser POD files. Another reason you might not want to use XML::Parser is because you need some feature that it doesnt provide (such as validation), or you might need to use a library that doesnt use expat, due to it not being installed on your system, or due to having a restrictive ISP. Using SAX allows you to work around these restrictions..

Requirements: No special requirements
Platforms: Linux
Keyword: Introduction Libraries Parsing Perl Programming Sax Sax Parsing Start State Using Xml Xmlsaxintro
Users rating: 0/10

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


XML::SAX::INTRO RELATED
Database Tools  -  Introduction to Object-Oriented Programming in MATLAB(R) Webinar 1.0
This contains the demo files and the presentation PDF file used in the "Introduction to Object-Oriented Programming in MATLAB(R)" Webinar, which was delivered in April 2009. These are meant to augment the Webinar, not replace it. Check out the...
30.72 KB  
Utilities  -  XML Parse Library 0.50
XML-Parse library is a lightweight set of re-usable functions for general purpose parsing, checking, and creating xml files. It can support stream-oriented, SAX or DOM parsing styles, and includes an optional xsd schema validator and graphical...
11.26 KB  
Network & Internet  -  mod_perl 2.0.3
mod_perl project brings together the full power of the Perl programming language and the Apache HTTP server. You can use Perl to manage Apache, respond to requests for web pages and much more. mod_perl gives you a persistent Perl interpreter...
3.5 MB  
Libraries  -  XML::Parser::PerlSAX 0.08
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);...
64.51 KB  
Libraries  -  libnxml 0.18.0
nXML is a C library for parsing, writing, and creating XML 1.0 and 1.1 files or streams. libnxml library supports UTF-8, UTF-16be and UTF-16le, UCS-4 (1234, 4321, 2143, 2312). Installation: The simplest way to compile this package is: 1....
337.92 KB  
Utilities  -  KDS XML 1.41
KDS XML is a class library for streamed parsing, validating and generating XML. It is written in Object Pascal/Delphi and works on Win32 (Delphi) and Linux (Kylix). Parts of it depend on the SAX for Pascal interface specifications.
819.2 KB  
Utilities  -  Perl OS 4
Perl OS is a program written in the Perl programming language combined with the Perl module Tk. Perl OS was created to make an easy interface to run Perl/Tk programs. It was also created to be an easy working environment complete with a text...
143.36 KB  
Libraries  -  XML::Records 0.12
XML::Records is a Perl module for perlish record-oriented interface to XML. SYNOPSIS use XML::Records; my $p=XML::Records->new(data.lst); $p->set_records(credit,debit); my ($t,$r) while ( (($t,$r)=$p->get_record()) && $t) { my...
7.17 KB  
Libraries  -  Games::Go::AGATourn 1.035
AGATourn is a Perl extensions to ease the pain of using AGA tournament data files. SYNOPSIS use Games::Go::AGATourn; my $agaTourn = Games::Go::AGATourn->new (options); An AGATourn object represents a round or several rounds of an American...
15.36 KB  
Development Editors  -  XML Parse Lib 0.63
XML Parse Lib is a handy, simple set of re-usable functions designed for general purpose parsing, checking, and creating xml files. It can support stream-oriented, SAX or DOM parsing styles, and includes an optional xsd schema validator and...
 
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