man POE::Filter::XML () - A POE Filter for parsing XML

NAME

POE::Filter::XML - A POE Filter for parsing XML

SYSNOPSIS

 use POE::Filter::XML;
 my $filter = POE::Filter::XML->new();

 my $wheel = POE::Wheel:ReadWrite->new(
        Filter          => $filter,
        InputEvent      => 'input_event',
 );

DESCRIPTION

POE::Filter::XML provides POE with a completely encapsulated XML parsing strategy for POE::Wheels that will be dealing with XML streams.

POE::Filter::XML relies upon XML::SAX and XML::SAX::ParserFactory to acquire a parser for parsing XML.

The assumed parser is XML::SAX::Expat::Incremental (Need a real push parser)

Default, the Filter will spit out POE::Filter::XML::Nodes because that is what the default XML::SAX compliant Handler produces from the stream it is given. You are of course encouraged to override the default Handler for your own purposes if you feel POE::Filter::XML::Node to be inadequate.

PUBLIC METHODS

Since POE::Filter::XML follows the POE::Filter API look to POE::Filter for documentation. The only method covered here is new()

new()
new() accepts a total of four(4) arguments that are all optional: (1) a string that is XML waiting to be parsed (i.e. xml received from the wheel before the Filter was instantiated), (2) a coderef to be executed upon a parsing error, (3) a XML::SAX complient Handler and (4) a meta Filter A secondary filter for another level of abstraction if desired, for example, say I want to use Serialize::XML in conjunction with POE::Filter::XML::Node, each POE::Filter::XML::Node would get delivered to the secondary filter where the Nodes are returned to XML and that xml interpreted to recreate perl objects. See POE::Filter::XML::Meta for implementing your own meta Filter.

BUGS AND NOTES

Previous versions relied upon XML::Parser (an expat derivative) or a very poor pure perl XML parser pulled from XML::Stream. XML::SAX is now the standard and has greatly simplified development on this project.

AUTHOR

Copyright (c) 2003, 2004, 2005 Nicholas Perez. Released and distributed under the GPL.