Commits

Anonymous committed 24e5f85

Modified Files:
Tag: mm_fix
Changes
* version updates

LibXML.pm
* version is now 1.49

LibXML.xs
[fix] catches all errors that are reported by libxml2, even if the
context lies about the state

Comments (0)

Files changed (3)

 Revision history for Perl extension XML::LibXML
 
+1.49
+   - memory management has been completely rewritten.
+        now the module should not cause that many memory leaks 
+   - ownerDocument fixed
+
 1.40
    - new parsefunction: $parser->parse_xml_chunk($string);
    - appendChild( $doc_fragment ) bug fixed
 use XML::LibXML::NodeList;
 use IO::Handle; # for FH reads called as methods
 
-$VERSION = "1.40";
+$VERSION = "1.49";
 require Exporter;
 require DynaLoader;
 
             RETVAL = &PL_sv_undef;    
             croak(SvPV(LibXML_error, len));
         }
+        else if (xmlDoValidityCheckingDefaultValue
+                 && SvLEN(LibXML_error) > 0
+                 && (real_dom->intSubset || real_dom->extSubset) ) {
+            croak(SvPV(LibXML_error, len));
+        }
         else {
             RETVAL = PmmNodeToSv((xmlNodePtr)real_dom, NULL);
         }        
             RETVAL = &PL_sv_undef;    
             croak(SvPV(LibXML_error, len));
         }
+        else if (xmlDoValidityCheckingDefaultValue
+                 && SvLEN(LibXML_error) > 0
+                 && (real_dom->intSubset || real_dom->extSubset)  ) {
+            croak(SvPV(LibXML_error, len));
+        }
         else {
             RETVAL = PmmNodeToSv((xmlNodePtr)real_dom,NULL);
         }
         
         sv_2mortal(LibXML_error);
         
-        if (!well_formed || (xmlDoValidityCheckingDefaultValue && !valid && (real_dom->intSubset || real_dom->extSubset) )) {
+        if (!well_formed || (xmlDoValidityCheckingDefaultValue && (!valid|| SvLEN(LibXML_error) > 0 ) && (real_dom->intSubset || real_dom->extSubset) )) {
             xmlFreeDoc(real_dom);
             RETVAL = &PL_sv_undef ;  
             croak(SvPV(LibXML_error, len));
         xmlValidCtxt cvp;
         xmlDtdPtr dtd;
         SV * dtd_sv;
+        STRLEN n_a;
     CODE:
         LibXML_error = sv_2mortal(newSVpv("", 0));
         cvp.userData = (void*)PerlIO_stderr();
                 croak("is_valid: argument must be a DTD object");
             }
             RETVAL = xmlValidateDtd(&cvp, doc , dtd);
+
         }
         else {
             RETVAL = xmlValidateDocument(&cvp, doc);