xml-axkit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject cvs commit: xml-axkit/lib/Apache/AxKit/Language XSP.pm
Date Tue, 18 Mar 2003 15:18:20 GMT
matts       2003/03/18 07:18:20

  Modified:    lib/Apache/AxKit/Language XSP.pm
  Log:
  Fix for xmlns="" bug
  
  Revision  Changes    Path
  1.39      +22 -16    xml-axkit/lib/Apache/AxKit/Language/XSP.pm
  
  Index: XSP.pm
  ===================================================================
  RCS file: /home/cvs/xml-axkit/lib/Apache/AxKit/Language/XSP.pm,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- XSP.pm	20 Feb 2003 10:22:19 -0000	1.38
  +++ XSP.pm	18 Mar 2003 15:18:20 -0000	1.39
  @@ -877,21 +877,15 @@
       }
   
       for my $attr (@{$node->{Attributes}}) {
  -#        $code .= '$parent->setAttribute(q(' . $attr->{Name} .
  -#                '), q(' . $attr->{Value} .
  -#                '));' . "\n";
           $code .= '$parent->setAttribute('.makeSingleQuoted($attr->{Name}).
                   ','.makeSingleQuoted($attr->{Value}).");\n";
       }
   
       for my $ns (keys %{$e->{Current_NS}}) {
  -#        $code .= '$parent->setAttribute("xmlns:" . q(' . $ns .'), q(' .
  -#                $e->{Current_NS}{$ns} . '));';
           if ($ns eq '#default') {
  -            $code .= '$parent->setAttribute("xmlns",' .
  +            $code .= '$parent->setAttributeNS("","xmlns",' .
                       makeSingleQuoted($e->{Current_NS}{$ns}) . ');';
           }
  -
           else {
               $code .= '$parent->setAttribute("xmlns:" . '.makeSingleQuoted($ns).',' .
                       makeSingleQuoted($e->{Current_NS}{$ns}) . ');';
  @@ -1040,14 +1034,26 @@
   
       foreach my $attr ($element->getAttributes) {
           my $lineno = eval { $attr->lineNumber; } if $debug;
  -        push @attr, {
  -            Name => encodeToUTF8($encoding,$attr->getName),
  -            Value => encodeToUTF8($encoding,$attr->getData),
  -            NamespaceURI => encodeToUTF8($encoding,$attr->getNamespaceURI),
  -            Prefix => encodeToUTF8($encoding,$attr->getPrefix),
  -            LocalName => encodeToUTF8($encoding,$attr->getLocalName),
  -            LineNumber => $lineno,
  -        };
  +        if ($attr->getName) {
  +            push @attr, {
  +                Name => encodeToUTF8($encoding,$attr->getName),
  +                Value => encodeToUTF8($encoding,$attr->getData),
  +                NamespaceURI => encodeToUTF8($encoding,$attr->getNamespaceURI),
  +                Prefix => encodeToUTF8($encoding,$attr->getPrefix),
  +                LocalName => encodeToUTF8($encoding,$attr->getLocalName),
  +                LineNumber => $lineno,
  +            };
  +        }
  +        else {
  +            push @attr, {
  +                Name => "xmlns",
  +                Value => "",
  +                NamespaceURI => "",
  +                Prefix => "",
  +                LocalName => "",
  +                LineNumber => $lineno,
  +            };
  +        }
       }
   
       my $lineno = eval { $element->lineNumber; } if $debug;
  
  
  

Mime
View raw message