Commits

ma...@9ae0c189-cd1f-4510-a509-f4891f5cf20d  committed 3191e21

Fixed attribute keys

  • Participants
  • Parent commits ef2e8fd

Comments (0)

Files changed (1)

File lib/XML/LibXML/SAX/Parser.pm

         my $key;
         # warn("Attr: $attr -> ", $attr->getName, " = ", $attr->getData, "\n");
         if ($attr->isa('XML::LibXML::Namespace')) {
+            # TODO This needs fixing modulo agreeing on what
+            # is the right thing to do here.
             my ($localname, $p);
             if (my $prefix = $attr->getLocalName) {
                 $key = "{" . $attr->getNamespaceURI . "}" . $prefix;
                 };
         }
         else {
-            if (my $ns = $attr->getNamespaceURI) {
-                $key = "{$ns}".$attr->getLocalName;
-            }
-            else {
-                $key = $attr->getLocalName;
-            }
+            my $ns = $attr->getNamespaceURI || '';
+            $key = "{$ns}".$attr->getLocalName;
             $attribs->{$key} =
                 {
                     Name => $attr->getName,