Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

XML::Filter::BufferText

Name XML::Filter::BufferText
Version 1.01
Located at /usr/local/share/perl5
File /usr/local/share/perl5/XML/Filter/BufferText.pm
Is Core No
Search CPAN for this module XML::Filter::BufferText
Documentation XML::Filter::BufferText
Module Details XML::Filter::BufferText


NAME

XML::Filter::BufferText - Filter to put all characters() in one event


SYNOPSIS

  my $h = SomeHandler->new;
  my $f = XML::Filter::BufferText->new( Handler => $h );
  my $p = SomeParser->new( Handler => $f );
  $p->parse;


DESCRIPTION

This is a very simple filter. One common cause of grief (and programmer error) is that XML parsers aren't required to provide character events in one chunk. They can, but are not forced to, and most don't. This filter does the trivial but oft-repeated task of putting all characters into a single event.

Note that this won't help you cases such as:

  <foo> blah <!-- comment --> phubar </foo>

In the above case, given the interleaving comment, there will be two character() events. This may be worked around in the future if there is demand for it.

An interesting way to use this filter, instead of telling users to use it, is to return it from your handler's constructor, already configured and all. That'll make the buffering totally transparent to them (XML::SAX::Writer does that).


AUTHOR

Robin Berjon, robin@knowscape.com


COPYRIGHT

Copyright (c) 2001-2002 Robin Berjon. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


SEE ALSO

XML::SAX::*, XML::Generator::*, XML::Handler::*, XML::Filter::*

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024