Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  XML::FILTER::GENERICCHUNK (3)

.ds Aq ’


XML::Filter::GenericChunk - Base Class for SAX Filters parsing WellBallanced Chunks



  use XML::Filter::GenericChunk;


XML::Filter::GenericChunk is inherited by XML::SAX::Base. XML::Filter::GenericChunk itself is an abstract class, therefore as a filter it will not result any useful output. If you need a simple Chunk filter for your SAX pipeline, check XML::Filter::CharacterChunk which is shipped with this module.

    The Constructor

new() is the constructor of this class. It takes three extra parameter:
<B>TagNameB> This expects an array reference with the TagNames the filter should handle.
<B>RelaxedNamesB> Relaxed name handling is an extra feature. RelaxedNames is a boolean switch, that allows one to filter all tags of a certain name - independant of the Namespace they belong to. This may is useful, but also dangerous, too. By default, strict namespace handling is activated.
<B>NamespaceURIB> If only a certain namespace should be filtered, this parameter allows to specify the NamespaceURI. If NamespaceURI is omited, the qualifing name is tested (prefix and local name), otherwise only the local name will be tested.


add_data This function is very important. It helps to collect the chunk until it is really processed. It takes an array of string, that are added to the chunk.
flush_chunk As the central feature method <B>flush_chunkB> will process the chunk that was set through <B>add_dataB> to the filter. The chunk will cause the filter to generate the appropiate SAX events as it would be processed by a XML parser.

If the chunk is not wellballanced, this function will <B>B>die()<B>B>. Therefore make shure it is wrapped into an eval block. In any case the currently stored chunk will be removed from the filter. Because of this <B>flush_chunkB> should only be called if the chunk should contain a valid chunk.

get_data simply returns the data collected by add_data() as a string value.
reset_data removes all data collected until this point.
get_data_fragment This function parses the data collected with add_data() into a document fragment. This function is internally used by flush_chunk(). It is pretty usefull, to use this function if one needs more control than flush_chunk() provides.
is_tag this function allows to test a inherited calls to find out, if the current sequence is handled by the filter.
relaxed_names This takes a boolean value in order to toggle the relax name handling after the filter creation.
set_namespace Sets/ removes the namespace uri of the filter.
set_tagname This method allows to add extra tag names to the list of tested tagnames. it expects an array instead of an array reference!
reset_tagname This helper function is used to remove all tagnames that are filtered.




Christian Glahn,, Innsbruck University


XML::LibXML, XML::SAX::Base, XML::Filter::CharacterChunk


Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 256: You forgot a ’=back’ before ’=head2’
Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 GENERICCHUNK (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.