Index: XHTML.pm
===================================================================
--- XHTML.pm (revision 4357)
+++ XHTML.pm (working copy)
@@ -237,8 +237,11 @@
my @n = ();
if( $xml->is( $node, "Element" ) )
{
- my $tagname = $node->localName; # ignore prefixes
+ my $tagname = $node->nodeName;
+ # strip namespaces that are no longer relevant or required in xhtml
+ $tagname =~ s/^(xhtml|ep[pc])://;
+
$tagname = lc($tagname);
push @n, '<', $tagname;
@@ -248,15 +251,22 @@
if( $tagname eq "html" )
{
push @n, ' xmlns="http://www.w3.org/1999/xhtml"';
+ $seen->{'xmlns'} = 1;
}
foreach my $i ( 0..$nnm->length-1 )
{
my $attr = $nnm->item($i);
- # strip all namespace definitions
- next if $attr->nodeName =~ /^xmlns/;
- my $name = $attr->localName;
+ # strip epp/epc namespace definitions
+ next if $attr->nodeName =~ /^xmlns:ep[pc]$/;
+ # dump epp/epc-namespaced attributes
+ next if $attr->prefix =~ /^ep[pc]$/;
+ my $name = $attr->nodeName;
+
+ # cleanup xhtml-namespaces attributes
+ $name =~ s/^xhtml://;
+
next if( exists $seen->{$name} );
$seen->{$name} = 1;