XML::Twig constructor disregarding map_xmlns - bug in module?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Has anyone experience any problems with map_xmlns?

This handler nevers gets called. This is very similar to the example
in the documentation, but for some reason it doesn't work.

use XML::Twig;
use strict;
my $twig = XML::Twig->new(
    map_xmlns => {
        "http://perlmonks.org "  => 'aaa',
        "http://perlmonks.org/blah "=> 'bbb'
    TwigHandlers => {
        '/aaa:monastery/aaa:foo/bbb:bar/bbb:monk' =>  sub { warn
"matched!"; $_[0]->purge; }

my $xml =<<XML;
<?xml version="1.0" encoding="UTF-8"?>
<prefix:monastery xmlns:prefix="http://perlmonks.org ">
    <prefix2:bar xmlns:prefix2="http://perlmonks.org/blah ">
       <prefix2:monk>Larry Wall</prefix2:monk>


Any ideas? Thanks a lot!

Site Timeline