XML::Filter::BufferText - Filter to put all characters() in one event
my $h = SomeHandler->new; my $f = XML::Filter::BufferText->new( Handler => $h ); my $p = SomeParser->new( Handler => $f ); $p->parse;
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).
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |