Shlomi Fish avatar 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);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.