Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xml::filter::buffertext(3pm) [debian man page]

BufferText(3pm) 					User Contributed Perl Documentation					   BufferText(3pm)

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 v5.10.0 2003-07-04 BufferText(3pm)

Check Out this Related Man Page

Test::XML::SAX(3pm)					User Contributed Perl Documentation				       Test::XML::SAX(3pm)

NAME
Test::XML::SAX - Test XML::SAX handlers SYNOPSIS
use Test::XML::SAX tests => 1; use My::XML::Filter; my $handler = My::XML::Filter->new; test_sax( $handler, '<foo />', '<bar/>', 'translates foo to bar' ); # ... In Another File ... use Test::XML::SAX; use My::XML::Filter; sub do_tests { my $handler = My::XML::Filter->new; test_sax( $handler, '<foo />', '<bar/>', 'translates foo to bar' ); } test_all_sax_parsers( &do_tests, 1 ); DESCRIPTION
This module is for testing XML::SAX handlers. FUNCTIONS
All functions are exported. test_sax ( HANDLER, INPUT, EXPECTED [, TESTNAME ] ) This function will process INPUT using HANDLER, and compare the result with EXPECTED. TESTNAME can optionally be used to name the test in the output (a good idea). test_all_sax_parsers ( SUB [, NUMTESTS ] ) This function will repeat a set of tests for all installed SAX parsers. SUB must be a coderef to run a series of tests. NUMTESTS is the number of tests inside SUB. NB: You must not issue a plan to Test::More if you call this function! The plan will be set for you, according to the number of parsers installed and NUMTESTS. This also means that you must not have any tests outside of SUB or you will get an error. When SUB is called, it will be passed two arguments. The name of the parser being used and the number of tests. It can use this information to decide whether or not to skip this set of tests. SEE ALSO
Test::More, Test::XML, XML::SAX. AUTHOR
Dominic Mitchell, <cpan2 (at) semantico.com> COPYRIGHT AND LICENSE
Copyright 2002 by semantico This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2009-07-02 Test::XML::SAX(3pm)
Man Page