When feeding XML::Twig with an XML document that defines a default namespace, then all elements that have no prefix get the #default prefix. This is probably due to XML::Parser::Expat
I assumed that using map_xmlns in the XML::Twig constructor will assign my prefix for the default namespace URL but it doesn't.
Here's an example for the XML Document:
<schema xmlns="http://www.w3.org/2001/XMLSchema"> <element name="alert"/> </schema>
Also, my XML::Twig constructor looks like this:
my $twig = XML::Twig->new( map_xmlns => { xsd => 'http://www.w3.org/2001/XMLSchema', }, );
The problem: when I print $twig->root->gi I get #default:schema while I expect to get xsd:schema.
How can I get XML::Twig to do what I expect it to do (show me the prefix that I assigned to the namespace URL and not show me the #default prefix)?
Thanks.
In reply to XML::Twig and #default prefix by DJpumps
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |