1BufferText(3) User Contributed Perl Documentation BufferText(3)
2
3
4
6 XML::Filter::BufferText - Filter to put all characters() in one event
7
9 my $h = SomeHandler->new;
10 my $f = XML::Filter::BufferText->new( Handler => $h );
11 my $p = SomeParser->new( Handler => $f );
12 $p->parse;
13
15 This is a very simple filter. One common cause of grief (and programmer
16 error) is that XML parsers aren't required to provide character events
17 in one chunk. They can, but are not forced to, and most don't. This
18 filter does the trivial but oft-repeated task of putting all characters
19 into a single event.
20
21 Note that this won't help you cases such as:
22
23 <foo> blah <!-- comment --> phubar </foo>
24
25 In the above case, given the interleaving comment, there will be two
26 "character()" events. This may be worked around in the future if there
27 is demand for it.
28
29 An interesting way to use this filter, instead of telling users to use
30 it, is to return it from your handler's constructor, already configured
31 and all. That'll make the buffering totally transparent to them
32 ("XML::SAX::Writer" does that).
33
35 Robin Berjon, robin@knowscape.com
36
38 Copyright (c) 2001-2002 Robin Berjon. All rights reserved. This program
39 is free software; you can redistribute it and/or modify it under the
40 same terms as Perl itself.
41
43 XML::SAX::*, XML::Generator::*, XML::Handler::*, XML::Filter::*
44
45
46
47perl v5.12.0 2003-07-04 BufferText(3)