Commits

Anonymous committed ebc326f

Modified Files:
Changes
+ version notes

LibXML.xs
- foo POD section

lib/XML/LibXML/SAX/Builder.pm
+ catches now brocken attributes (no name, no value)

  • Participants
  • Parent commits 19637b5

Comments (0)

Files changed (3)

 versions. Make shure you read the informations on the XML::LibXML::DOM
 manpage!
 
+1.53
+   - fixed very stupid encoding bug. all UTF8 strings will now be marked as 
+     UTF8
+   - made XML::LibXML::SAX parser running without errors in most cases 
+     (DTD handling is still not implemented)
+
 1.52
    - fixed some typos (thanks to randy kobes and hildo biersma)
    - fixed namespace node handling
     CODE:
         xmlCleanupParser();
 
-=head1 Some POD here
-
-Foo
-
-=cut
-
 int
 XML_ELEMENT_NODE()
     ALIAS: 
         xmlNodePtr rnode = PmmSvNode(node);
         xmlChar * lname;
     CODE:
-        lname = xmlStrdup( rnode->name );
-        RETVAL = C2Sv(lname,NULL);
-        xmlFree( lname );
+        RETVAL = C2Sv(rnode->name,NULL);
     OUTPUT:
         RETVAL
 
     CODE:
         if( rnode->ns != NULL
             && rnode->ns->prefix != NULL ) {            
-            prefix = xmlStrdup(rnode->ns->prefix);
-            RETVAL = C2Sv(prefix, NULL);
-            xmlFree(prefix);
+            RETVAL = C2Sv(rnode->ns->prefix, NULL);
         }
         else {
             XSRETURN_UNDEF;

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

     foreach my $p ( $self->{NamespaceStack}->get_declared_prefixes() ) {
         my $uri = $self->{NamespaceStack}->get_uri($p);
         my $nodeflag = 0;
-        if ( defined $uri 
-             and defined $el->{NamespaceURI} 
+        if ( defined $uri
+             and defined $el->{NamespaceURI}
              and $uri eq $el->{NamespaceURI} ) {
             $nodeflag = 1;
         }
     foreach my $key (keys %{$el->{Attributes}}) {
         my $attr = $el->{Attributes}->{$key};
         if (ref($attr)) {
-            next if $self->{USENAMESPACESTACK} == 1
+            # catch broken name/value pairs
+            next unless $attr->{Name} && $attr->{Value};
+            next if $self->{USENAMESPACESTACK}
                     and ( $attr->{Name} eq "xmlns"
                           or ( defined $attr->{Prefix}
                                and $attr->{Prefix} eq "xmlns" ) );