BufferText(3)
BufferText(3) π¦β¨
okay bestie, welcome to BufferText(3) from the User Contributed Perl Documentation corner of the internet. This is the manual page for XML::Filter::BufferText, a tiny Perl filter with main character energy and one very specific job. Slay. π
πΈ NAME πΈ
XML::Filter::BufferText β Filter to put all characters() in one event. That's the whole vibe. π
β¨ 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. Like, no drama, just buffering.
Here's the tea: 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. Iconic behavior, honestly.
Note that this won't help you in 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). Obsessed. π«Ά
π 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::*
signed off from the perl v5.42.0 era, dated 2012-01-11, still serving BufferText(3) realness π
π¦ where this page comes from
- opensuse-leap 16.0: perl-XML-Filter-BufferText 1.01-160000.2.2 Β· GPL-1.0+ or Artistic-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms