[ANNOUNCE] XML::Filter::Merger: Easier merging yet...
by Barrie Slaymaker other posts by this author
Sep 6 2002 2:31PM messages near this date
view in the new Beta List Site
RE: XML::Schema, anyone?
|
weired XML::LibXML bug
XML-SAX-Machines v0.38 provides a merger that lets you do:
$h-> start_document( {} );
$h-> start_element( { Name => "foo1" } );
$p-> parse_string( "<foo2><baz /></foo2>" );
$h-> end_element( { Name => "foo1" } );
$h-> end_document( {} );
to get:
<foo1> <baz /></foo1>} ;
and, more importantly for my needs, you can subclass it to build in
your own XInclude-like functionality:
package Subclass;
use vars qw( @ISA );
@ISA = qw( XML::Filter::Merger );
sub characters {
my $self = shift;
my $r = $self-> SUPER::characters( @_ );
$self-> set_include_all_roots( 1 );
XML::SAX::PurePerl-> new( Handler => $self )->parse_string( "<hey/>" );
return $r;
}
1;
That inserts a "<hey /> " after each characters() event. Useless, but it
should give you the idea.
- Barrie
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|