Commits

Shlomi Fish committed 3c63322

Fix the node normalization (RT #53623).

Comments (0)

Files changed (3)

         - Add "use strict" and "use warnings".
         - Add resources and keywords to the META_MERGE.
         - Other changes.
+    - Fix https://rt.cpan.org/Public/Bug/Display.html?id=53632 :
+        - << when calling normalize on a node, processing of children nodes 
+        will stop when an empty element node is encountered. >>
+        - Thanks to Daniel Frett for the patch.
 
 1.72            Thu Jun 16 19:26:13 IDT 2011
     - Removed a stray file from the MANIFEST
 int
 domNodeNormalizeList( xmlNodePtr nodelist )
 {
-    if ( nodelist == NULL ) 
-        return(0);
-
     while ( nodelist ){
         if ( domNodeNormalize( nodelist ) == 0 )
             return(0);
     my $t2 = $doc->createTextNode( "bar2" );
     my $t3 = $doc->createTextNode( "bar3" );
     my $e  = $doc->createElement("foo");
+    my $e2 = $doc->createElement("bar");
+    $e->appendChild( $e2 );
     $e->appendChild( $t1 );
     $e->appendChild( $t2 );
     $e->appendChild( $t3 );
 
     # this is the correct behaviour for DOM. the nodes are still
     # refered
-    ok( scalar( @cn ), 3 );
+    ok( scalar( @cn ), 4 );
     
     $e->normalize;
     
     @cn = $e->childNodes;
-    ok( scalar( @cn ), 1 );
+    ok( scalar( @cn ), 2 );
 
     ok(not defined $t2->parentNode);
     ok(not defined $t3->parentNode);