sax
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 100
XML::SAX 0.14
XML::SAX is a simple API for XML. more>>
XML::SAX is a simple API for XML.
SYNOPSIS
use XML::SAX;
# get a list of known parsers
my $parsers = XML::SAX->parsers();
# add/update a parser
XML::SAX->add_parser(q(XML::SAX::PurePerl));
# remove parser
XML::SAX->remove_parser(q(XML::SAX::Foodelberry));
# save parsers
XML::SAX->save_parsers();
XML::SAX is a SAX parser access API for Perl. It includes classes and APIs required for implementing SAX drivers, along with a factory class for returning any SAX parser installed on the users system.
<<lessSYNOPSIS
use XML::SAX;
# get a list of known parsers
my $parsers = XML::SAX->parsers();
# add/update a parser
XML::SAX->add_parser(q(XML::SAX::PurePerl));
# remove parser
XML::SAX->remove_parser(q(XML::SAX::Foodelberry));
# save parsers
XML::SAX->save_parsers();
XML::SAX is a SAX parser access API for Perl. It includes classes and APIs required for implementing SAX drivers, along with a factory class for returning any SAX parser installed on the users system.
Download (0.057MB)
Added: 2006-09-08 License: GPL (GNU General Public License) Price:
1142 downloads
Sax Filter 1.4
Sax Filter is a modular set of filters that can be used to process XML documents via Javas SAX support. more>>
Sax Filter is a modular set of filters that can be used to process XML documents via Javas SAX support.
Currently, the filters only process content (the ContentHandler interface).
<<lessCurrently, the filters only process content (the ContentHandler interface).
Download (0.048MB)
Added: 2006-12-24 License: GPL (GNU General Public License) Price:
1035 downloads
Pod::SAX 0.14
Pod::SAX is a SAX parser for Pod. more>>
Pod::SAX is a SAX parser for Pod.
SYNOPSIS
my $h = XML::SAX::Writer->new();
my $p = Pod::SAX->new( Handler => $h );
$p->parse_uri(perlpodspec.pod);
Very simply, this module parses POD (or perl) files and turns the Plain Old Documentation into SAX events (which often youll use to turn into XML, but there are other uses as well).
The aim of this module is not round-tripping, so some things may be lost in the conversion. The aim is to be as standards compliant as possible, while giving you very simple access to the data.
The main motivation for this module though was simple standards compliance - all the Pod parsers out there seem to have their own unique way of doing things, and so my aim was to unify that and allow the flexibility that SAX gives me at the same time.
For an introduction to SAX, please read XML::SAX::Intro.
One very important point to note is that just because this is a SAX module it doesnt mandate that the results are XML. You could just as easily use this module to extract all filenames from a POD file, or extract custom =for/=begin sections. And because it uses standardised interfaces this is a lot simpler than working with any other POD parser out there, and the knowledge is transferrable.
<<lessSYNOPSIS
my $h = XML::SAX::Writer->new();
my $p = Pod::SAX->new( Handler => $h );
$p->parse_uri(perlpodspec.pod);
Very simply, this module parses POD (or perl) files and turns the Plain Old Documentation into SAX events (which often youll use to turn into XML, but there are other uses as well).
The aim of this module is not round-tripping, so some things may be lost in the conversion. The aim is to be as standards compliant as possible, while giving you very simple access to the data.
The main motivation for this module though was simple standards compliance - all the Pod parsers out there seem to have their own unique way of doing things, and so my aim was to unify that and allow the flexibility that SAX gives me at the same time.
For an introduction to SAX, please read XML::SAX::Intro.
One very important point to note is that just because this is a SAX module it doesnt mandate that the results are XML. You could just as easily use this module to extract all filenames from a POD file, or extract custom =for/=begin sections. And because it uses standardised interfaces this is a lot simpler than working with any other POD parser out there, and the knowledge is transferrable.
Download (0.014MB)
Added: 2006-09-18 License: Perl Artistic License Price:
1131 downloads
DomSax 1.0.0
DomSax is an implementation of a XML-parser based on the standard Document Object Model principle. more>>
DomSax is an implementation of a XML-parser based on the standard Document Object Model principle (and suns implementation), combining it with the flexibility and possibility of low memory consumption of the SAX-parser (also suns implementation).
Based on the fact that most XML-documents contain repeating blocks (eg the same structure of elements repeated over and over), the parser creates for each repeating block a complete document (with the document-root being the start-element of the repeating block). This enables the programmer to keep the code clean and the memory consumption within bounds.
The parser has been tested on java 1.5.1.
For parsing XML-files there are currently two options: SAX and DOM. With SAX you get the flexibility to load specific elements from a stream, minimizing memory consumption, but complicating searches and decreasing load-time. With DOM you get the nice interface for searching elements in the completely loaded document, but this interface comes with a high cost in memory consumption and low speed.
When I started with this project one of the demands was the ability to process xml-files of 100+ Mb. This left me effectively only the choice of SAX, which allows for parsing the file element for element and enable me to keep the memory consumption within bounds. However I didnt like the implications on the code for the project. Anyone who ever created a parser with SAX will agree that youre left with a mess, because of the separation of receiving the open-tag, data and close-tag.
So what I wanted was the flexibility of the SAX parser combined with the ease of use of the DOM approach. The underlying principle of DomSax is repeating blocks, which can be indicated with the existing XPath technology. Most xml-files store records, which are always described in the same manner (eg repeating blocks).
In the example below there is a single header, which is always the first element within the document-root tag (blue box). After the header the elements follow (orange boxes). For each of the boxes indicated to the parser with an xpath a complete document is created, containing only the data within the box. After the document is completed it is passed to the registered listeners.
<<lessBased on the fact that most XML-documents contain repeating blocks (eg the same structure of elements repeated over and over), the parser creates for each repeating block a complete document (with the document-root being the start-element of the repeating block). This enables the programmer to keep the code clean and the memory consumption within bounds.
The parser has been tested on java 1.5.1.
For parsing XML-files there are currently two options: SAX and DOM. With SAX you get the flexibility to load specific elements from a stream, minimizing memory consumption, but complicating searches and decreasing load-time. With DOM you get the nice interface for searching elements in the completely loaded document, but this interface comes with a high cost in memory consumption and low speed.
When I started with this project one of the demands was the ability to process xml-files of 100+ Mb. This left me effectively only the choice of SAX, which allows for parsing the file element for element and enable me to keep the memory consumption within bounds. However I didnt like the implications on the code for the project. Anyone who ever created a parser with SAX will agree that youre left with a mess, because of the separation of receiving the open-tag, data and close-tag.
So what I wanted was the flexibility of the SAX parser combined with the ease of use of the DOM approach. The underlying principle of DomSax is repeating blocks, which can be indicated with the existing XPath technology. Most xml-files store records, which are always described in the same manner (eg repeating blocks).
In the example below there is a single header, which is always the first element within the document-root tag (blue box). After the header the elements follow (orange boxes). For each of the boxes indicated to the parser with an xpath a complete document is created, containing only the data within the box. After the document is completed it is passed to the registered listeners.
Download (0.018MB)
Added: 2006-08-24 License: LGPL (GNU Lesser General Public License) Price:
1156 downloads
GooeySAX 2.0
GooeySAX is a cross-platform tool that wraps an underlying SAX parser (Apache Xerces, to be exact) in a Java Swing interface. more>>
GooeySAX is a cross-platform tool that wraps an underlying SAX parser (Apache Xerces, to be exact) in a Java Swing interface. You can use GooeySAX to parse XML documents on your local file system or across the network to determine their Well-Formedness.
With the optional Validity setting enabled, you may also validate your document against a DTD. New in version 2.0 -- W3C XML Schema validation support as well!
GooeySAX is the perfect tool for the web author who cares!
Checking your XHTML documents validity either locally or remotely is a snap, and GooeySAXs detailed error messages let you know about those embarassing validation errors immediately.
GooeySAX is easy to use... select an XML document for parsing in one of three ways:
Type a URL into GooeySAXs System ID location bar.
Select File menu -> Browse... to browse for a file on your local system.
Drag a file from you local system onto the GooeySAX window.
Then select the Validate checkbox if you wish to validate your document against a DTD. How do you select the DTD against which to validate? Easy! Simply declare the DTD in your documents Doctype Declaration or declare the XML Schema instance as normal... GooeySAX will figure out the rest!
Finally, click the Parse button and watch the results appear.
<<lessWith the optional Validity setting enabled, you may also validate your document against a DTD. New in version 2.0 -- W3C XML Schema validation support as well!
GooeySAX is the perfect tool for the web author who cares!
Checking your XHTML documents validity either locally or remotely is a snap, and GooeySAXs detailed error messages let you know about those embarassing validation errors immediately.
GooeySAX is easy to use... select an XML document for parsing in one of three ways:
Type a URL into GooeySAXs System ID location bar.
Select File menu -> Browse... to browse for a file on your local system.
Drag a file from you local system onto the GooeySAX window.
Then select the Validate checkbox if you wish to validate your document against a DTD. How do you select the DTD against which to validate? Easy! Simply declare the DTD in your documents Doctype Declaration or declare the XML Schema instance as normal... GooeySAX will figure out the rest!
Finally, click the Parse button and watch the results appear.
Download (MB)
Added: 2006-05-09 License: Freeware Price:
1264 downloads
XML::SAX::Simple 0.02
XML::SAX::Simple is a SAX version of XML::Simple. more>>
XML::SAX::Simple is a SAX version of XML::Simple.
SYNOPSIS
use XML::SAX::Simple qw(XMLin XMLout);
my $hash = XMLin("foo.xml");
XML::SAX::Simple is a very simple version of XML::Simple but for SAX. It can be used as a complete drop-in replacement for XML::Simple.
See the documentation for XML::Simple (which is required for this module to work) for details.
<<lessSYNOPSIS
use XML::SAX::Simple qw(XMLin XMLout);
my $hash = XMLin("foo.xml");
XML::SAX::Simple is a very simple version of XML::Simple but for SAX. It can be used as a complete drop-in replacement for XML::Simple.
See the documentation for XML::Simple (which is required for this module to work) for details.
Download (0.016MB)
Added: 2006-09-08 License: Perl Artistic License Price:
1141 downloads
XML::SAX::Base 1.02
XML::SAX::Base is a base class SAX Drivers and Filters. more>>
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.
<<lessSYNOPSIS
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.
Download (0.020MB)
Added: 2007-06-21 License: Perl Artistic License Price:
855 downloads
XML::SAX::Intro 0.14
XML::SAX::Intro is an Introduction to SAX Parsing with Perl. more>>
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.
<<lessXML::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.
Download (0.057MB)
Added: 2006-09-12 License: Perl Artistic License Price:
1137 downloads
XML::SAX::Machine 0.41
XML::SAX::Machine is a Perl module that can manage a collection of SAX processors. more>>
XML::SAX::Machine is a Perl module that can manage a collection of SAX processors.
SYNOPSIS
## Note: See XML::SAX::Pipeline and XML::SAX::Machines first,
## this is the gory, detailed interface.
use My::SAX::Machines qw( Machine );
use My::SAX::Filter2;
use My::SAX::Filter3;
my $filter3 = My::SAX::Filter3->new;
## A simple pipeline. My::SAX::Filter1 will be autoloaded.
my $m = Machine(
#
# Name => Class/object => handler(s)
#
[ Intake => "My::SAX::Filter1" => "B" ],
[ B => My::SAX::Filter2->new() => "C" ],
[ C => $filter3 => "D" ],
[ D => *STDOUT ],
);
## A parser will be created unless My::SAX::Filter1 can parse_file
$m->parse_file( "foo.revml" );
my $m = Machine(
[ Intake => "My::SAX::Filter1" => qw( Tee ) ],
[ Tee => "XML::Filter::SAXT" => qw( Foo Bar ) ],
[ Foo => "My::SAX::Filter2" => qw( Out1 ) ],
[ Out1 => $log ],
[ Bar => "My::SAX::Filter3" => qw( Exhaust ) ],
);
WARNING: This API is alpha!!! It will be changing.
A generic SAX machine (an instance of XML::SAX::Machine) is a container of SAX processors (referred to as "parts") connected in arbitrary ways.
Each parameter to Machine() (or XML::SAX::Machine-new()>) represents one top level part of the machine. Each part has a name, a processor, and one or more handlers (usually specified by name, as shown in the SYNOPSIS).
Since SAX machines may be passed in as single top level parts, you can also create nested, complex machines ($filter3 in the SYNOPSIS could be a Pipeline, for example).
A SAX machines can act as a normal SAX processors by connecting them to other SAX processors:
my $w = My::Writer->new();
my $m = Machine( ...., { Handler => $w } );
my $g = My::Parser->new( Handler => $w );
<<lessSYNOPSIS
## Note: See XML::SAX::Pipeline and XML::SAX::Machines first,
## this is the gory, detailed interface.
use My::SAX::Machines qw( Machine );
use My::SAX::Filter2;
use My::SAX::Filter3;
my $filter3 = My::SAX::Filter3->new;
## A simple pipeline. My::SAX::Filter1 will be autoloaded.
my $m = Machine(
#
# Name => Class/object => handler(s)
#
[ Intake => "My::SAX::Filter1" => "B" ],
[ B => My::SAX::Filter2->new() => "C" ],
[ C => $filter3 => "D" ],
[ D => *STDOUT ],
);
## A parser will be created unless My::SAX::Filter1 can parse_file
$m->parse_file( "foo.revml" );
my $m = Machine(
[ Intake => "My::SAX::Filter1" => qw( Tee ) ],
[ Tee => "XML::Filter::SAXT" => qw( Foo Bar ) ],
[ Foo => "My::SAX::Filter2" => qw( Out1 ) ],
[ Out1 => $log ],
[ Bar => "My::SAX::Filter3" => qw( Exhaust ) ],
);
WARNING: This API is alpha!!! It will be changing.
A generic SAX machine (an instance of XML::SAX::Machine) is a container of SAX processors (referred to as "parts") connected in arbitrary ways.
Each parameter to Machine() (or XML::SAX::Machine-new()>) represents one top level part of the machine. Each part has a name, a processor, and one or more handlers (usually specified by name, as shown in the SYNOPSIS).
Since SAX machines may be passed in as single top level parts, you can also create nested, complex machines ($filter3 in the SYNOPSIS could be a Pipeline, for example).
A SAX machines can act as a normal SAX processors by connecting them to other SAX processors:
my $w = My::Writer->new();
my $m = Machine( ...., { Handler => $w } );
my $g = My::Parser->new( Handler => $w );
Download (0.042MB)
Added: 2007-07-31 License: Perl Artistic License Price:
815 downloads
XML::SAX::Writer 0.50
XML::SAX::Writer is a Perl module with SAX2 Writer. more>>
XML::SAX::Writer is a Perl module with SAX2 Writer.
SYNOPSIS
use XML::SAX::Writer;
use XML::SAX::SomeDriver;
my $w = XML::SAX::Writer->new;
my $d = XML::SAX::SomeDriver->new(Handler => $w);
$d->parse(some options...);
Why yet another XML Writer ?
A new XML Writer was needed to match the SAX2 effort because quite naturally no existing writer understood SAX2. My first intention had been to start patching XML::Handler::YAWriter as it had previously been my favourite writer in the SAX1 world.
However the more I patched it the more I realised that what I thought was going to be a simple patch (mostly adding a few event handlers and changing the attribute syntax) was turning out to be a rewrite due to various ideas Id been collecting along the way. Besides, I couldnt find a way to elegantly make it work with SAX2 without breaking the SAX1 compatibility which people are probably still using. There are of course ways to do that, but most require user interaction which is something I wanted to avoid.
So in the end there was a new writer. I think its in fact better this way as it helps keep SAX1 and SAX2 separated.
<<lessSYNOPSIS
use XML::SAX::Writer;
use XML::SAX::SomeDriver;
my $w = XML::SAX::Writer->new;
my $d = XML::SAX::SomeDriver->new(Handler => $w);
$d->parse(some options...);
Why yet another XML Writer ?
A new XML Writer was needed to match the SAX2 effort because quite naturally no existing writer understood SAX2. My first intention had been to start patching XML::Handler::YAWriter as it had previously been my favourite writer in the SAX1 world.
However the more I patched it the more I realised that what I thought was going to be a simple patch (mostly adding a few event handlers and changing the attribute syntax) was turning out to be a rewrite due to various ideas Id been collecting along the way. Besides, I couldnt find a way to elegantly make it work with SAX2 without breaking the SAX1 compatibility which people are probably still using. There are of course ways to do that, but most require user interaction which is something I wanted to avoid.
So in the end there was a new writer. I think its in fact better this way as it helps keep SAX1 and SAX2 separated.
Download (0.012MB)
Added: 2006-09-21 License: Perl Artistic License Price:
1128 downloads
iCal::Parser::SAX 1.07
iCal::Parser::SAX is a Perl module to generate SAX events from an iCalendar. more>>
iCal::Parser::SAX is a Perl module to generate SAX events from an iCalendar.
SYNOPSIS
use iCal::Parser::SAX;
my $parser=iCal::Parser::SAX->new(Handler=>SAXHandler,%args);
$parser->parse_uri($file);
$parser->parse_uris(@files);
This module uses iCal::Parser to generates SAX events for the calendar contents.
The xml document generated is designed for creating monthly calendars with weeks beginning on monday (e.g., by passing the output through an xsl styleheet).
The basic structure of the generated document (if output through a simple output handler like XML::SAX::Writer), is as follows:
< ical>
< calendars>
< calendar id="cal-id" index="n" name="..." description="..."/>
< /calendars>
< events>
< year year="YYYY">
< month month="[1-12]">
< week week="n">
< day date="YYYY-MM-DD">
< event uid="event-id" idref="cal-id" [all-day="1"]>
< !-- ... -->
< /event>
< /day>
< /week>
< /month>
< /events>
< todos>
< todo idref="cal-id" uid="...">
< !--- ... -->
< /todo>
< /todos>
< /ical>
Along with basics, such as converting calendar attributes to lowercase elements (e.g., a DTSTART attribute in the input would generate a sax event like element({Name=dtstart})>), a number of other processes occur:
day elements are are generated for each date within the months from the first month in the input to the last, even if there are no calendar events on that day. This guarantees a complete calendar month for further processing. If there is an overlap between two or more events, the attribute conflict, containing the number of concurrent overlaps, is added to the element.
If the beginning or end of the month does not start on a monday, or end on a sunday, the days from the previous (next) month month are duplicated within the first (last) week of the current month, including duplicate copies of any calendar events occuring on those days. This allows for displaying a monthly calendar the same way a program such as Apples iCal would, with calendar events showing up if they fall within the overlapping days in the first or last week of a monthly calendar.
<<lessSYNOPSIS
use iCal::Parser::SAX;
my $parser=iCal::Parser::SAX->new(Handler=>SAXHandler,%args);
$parser->parse_uri($file);
$parser->parse_uris(@files);
This module uses iCal::Parser to generates SAX events for the calendar contents.
The xml document generated is designed for creating monthly calendars with weeks beginning on monday (e.g., by passing the output through an xsl styleheet).
The basic structure of the generated document (if output through a simple output handler like XML::SAX::Writer), is as follows:
< ical>
< calendars>
< calendar id="cal-id" index="n" name="..." description="..."/>
< /calendars>
< events>
< year year="YYYY">
< month month="[1-12]">
< week week="n">
< day date="YYYY-MM-DD">
< event uid="event-id" idref="cal-id" [all-day="1"]>
< !-- ... -->
< /event>
< /day>
< /week>
< /month>
< /events>
< todos>
< todo idref="cal-id" uid="...">
< !--- ... -->
< /todo>
< /todos>
< /ical>
Along with basics, such as converting calendar attributes to lowercase elements (e.g., a DTSTART attribute in the input would generate a sax event like element({Name=dtstart})>), a number of other processes occur:
day elements are are generated for each date within the months from the first month in the input to the last, even if there are no calendar events on that day. This guarantees a complete calendar month for further processing. If there is an overlap between two or more events, the attribute conflict, containing the number of concurrent overlaps, is added to the element.
If the beginning or end of the month does not start on a monday, or end on a sunday, the days from the previous (next) month month are duplicated within the first (last) week of the current month, including duplicate copies of any calendar events occuring on those days. This allows for displaying a monthly calendar the same way a program such as Apples iCal would, with calendar events showing up if they fall within the overlapping days in the first or last week of a monthly calendar.
Download (0.022MB)
Added: 2007-04-02 License: Perl Artistic License Price:
935 downloads
Tree::Simple::SAX 0.01
Tree::Simple::SAX is a set of classes for using Tree::Simple with XML. more>>
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 = XML::SAX::ParserFactory->parser(Handler => $handler);
$p->parse_string( Hello ! );
# this will create a tree like this:
# { tag_type => xml }
# { tag_type => string }
# { content => Hello , tag_type => CDATA }
# { tag_type => world }
# { content => !, tag_type => CDATA }
This is an early implementation of an XML::SAX handler which creates a Tree::Simple object hierarchy from the XML stream. It is currently in the proof-of-concept/experimental stages and I plan to add more features in the future.
If anyone else is interested in the development of this module, feel free to contact me (use the email in the AUTHOR section). I am always open to discussion, thoughts, criticism and especially patches.
<<lessSYNOPSIS
use Tree::Simple::SAX;
use XML::SAX::ParserFactory;
my $handler = Tree::Simple::SAX::Handler->new(Tree::Simple->new());
my $p = XML::SAX::ParserFactory->parser(Handler => $handler);
$p->parse_string( Hello ! );
# this will create a tree like this:
# { tag_type => xml }
# { tag_type => string }
# { content => Hello , tag_type => CDATA }
# { tag_type => world }
# { content => !, tag_type => CDATA }
This is an early implementation of an XML::SAX handler which creates a Tree::Simple object hierarchy from the XML stream. It is currently in the proof-of-concept/experimental stages and I plan to add more features in the future.
If anyone else is interested in the development of this module, feel free to contact me (use the email in the AUTHOR section). I am always open to discussion, thoughts, criticism and especially patches.
Download (0.004MB)
Added: 2006-09-14 License: Perl Artistic License Price:
1135 downloads
XML::SAX::ByRecord 0.41
XML::SAX::ByRecord can record oriented processing of (data) documents. more>>
XML::SAX::ByRecord can record oriented processing of (data) documents.
SYNOPSIS
use XML::SAX::Machines qw( ByRecord ) ;
my $m = ByRecord(
"My::RecordFilter1",
"My::RecordFilter2",
...
{
Handler => $h, ## optional
}
);
$m->parse_uri( "foo.xml" );
XML::SAX::ByRecord is a SAX machine that treats a document as a series of records. Everything before and after the records is emitted as-is while the records are excerpted in to little mini-documents and run one at a time through the filter pipeline contained in ByRecord.
The output is a document that has the same exact things before, after, and between the records that the input document did, but which has run each record through a filter. So if a document has 10 records in it, the per-record filter pipeline will see 10 sets of ( start_document, body of record, end_document ) events. An example is below.
This has several use cases:
- Big, record oriented documents
Big documents can be treated a record at a time with various DOM oriented processors like XML::Filter::XSLT.
- Streaming XML
Small sections of an XML stream can be run through a document processor without holding up the stream.
- Record oriented style sheets / processors
Sometimes its just plain easier to write a style sheet or - SAX filter that applies to a single record at at time, rather than having to run through a series of records.
<<lessSYNOPSIS
use XML::SAX::Machines qw( ByRecord ) ;
my $m = ByRecord(
"My::RecordFilter1",
"My::RecordFilter2",
...
{
Handler => $h, ## optional
}
);
$m->parse_uri( "foo.xml" );
XML::SAX::ByRecord is a SAX machine that treats a document as a series of records. Everything before and after the records is emitted as-is while the records are excerpted in to little mini-documents and run one at a time through the filter pipeline contained in ByRecord.
The output is a document that has the same exact things before, after, and between the records that the input document did, but which has run each record through a filter. So if a document has 10 records in it, the per-record filter pipeline will see 10 sets of ( start_document, body of record, end_document ) events. An example is below.
This has several use cases:
- Big, record oriented documents
Big documents can be treated a record at a time with various DOM oriented processors like XML::Filter::XSLT.
- Streaming XML
Small sections of an XML stream can be run through a document processor without holding up the stream.
- Record oriented style sheets / processors
Sometimes its just plain easier to write a style sheet or - SAX filter that applies to a single record at at time, rather than having to run through a series of records.
Download (0.042MB)
Added: 2007-08-17 License: Perl Artistic License Price:
798 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
Mac::PropertyList::SAX 0.09
Mac::PropertyList::SAX is a Perl module to work with Mac plists at a low level (with real XML parsers). more>>
Mac::PropertyList::SAX is a Perl module to work with Mac plists at a low level (with real XML parsers).
Mac::PropertyList is useful, but very slow on large files because it does the parsing by itself, intead of handing off the actual XML parsing to a dedicated parser. This module uses XML::SAX::ParserFactory to select a parser capable of doing the heavy lifting, reducing parsing time on large files by up to 97%. This is especially useful for iTunes library plists which may be megabytes in size and contain thousands of entries in dozens of dictionaries.
This module does not, however, replace Mac::PropertyList; in fact, it depends on it for several package definitions and the plist creation routines.
Be aware that performance will depend largely on the parser that XML::SAX::ParserFactory selects for you; if you have not installed XML::SAX::Expat or another fast parser, the default XML::SAX::PurePerl parser will be used; this will probably give worse performance than Mac::PropertyList, so ensure that a fast parser is being used before you complain to me about performance :-). See XML::SAX::ParserFactory for information on how to set which parser is used.
<<lessMac::PropertyList is useful, but very slow on large files because it does the parsing by itself, intead of handing off the actual XML parsing to a dedicated parser. This module uses XML::SAX::ParserFactory to select a parser capable of doing the heavy lifting, reducing parsing time on large files by up to 97%. This is especially useful for iTunes library plists which may be megabytes in size and contain thousands of entries in dozens of dictionaries.
This module does not, however, replace Mac::PropertyList; in fact, it depends on it for several package definitions and the plist creation routines.
Be aware that performance will depend largely on the parser that XML::SAX::ParserFactory selects for you; if you have not installed XML::SAX::Expat or another fast parser, the default XML::SAX::PurePerl parser will be used; this will probably give worse performance than Mac::PropertyList, so ensure that a fast parser is being used before you complain to me about performance :-). See XML::SAX::ParserFactory for information on how to set which parser is used.
Download (0.013MB)
Added: 2007-04-03 License: Perl Artistic License Price:
936 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 sax 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