1. Shlomi Fish
  2. perl-XML-LibXML

Commits

ma...@9ae0c189-cd1f-4510-a509-f4891f5cf20d  committed 313a6ea

Compile on 5.00503
Fixed validating mode in various ways

  • Participants
  • Parent commits 3133aca
  • Branches default

Comments (0)

Files changed (1)

File LibXML.xs

View file
  • Ignore whitespace
     }
 
 #define TEST_PERL_FLAG(flag) \
-    SvTRUE(get_sv(flag, FALSE)) ? 1 : 0
+    SvTRUE(perl_get_sv(flag, FALSE)) ? 1 : 0
 
 typedef struct _ProxyObject ProxyObject;
 
         }
     }
     
-    if (!well_formed || (xmlDoValidityCheckingDefaultValue && !valid)) {
+    if (!well_formed || (xmlDoValidityCheckingDefaultValue && !valid && (doc->intSubset || doc->extSubset) )) {
         xmlFreeDoc(doc);
         return NULL;
     }
         xmlFreeParserCtxt(ctxt);
 
         sv_2mortal(LibXML_error);
-        if (!well_formed || (xmlDoValidityCheckingDefaultValue && !valid)) {
+
+        if (!well_formed || (xmlDoValidityCheckingDefaultValue && !valid && (real_dom->intSubset || real_dom->extSubset) )) {
             xmlFreeDoc(real_dom);
             RETVAL = &PL_sv_undef;    
             croak(SvPV(LibXML_error, len));
         
         sv_2mortal(LibXML_error);
         
-        if (!well_formed || (xmlDoValidityCheckingDefaultValue && !valid)) {
+        if (!well_formed || (xmlDoValidityCheckingDefaultValue && !valid && (real_dom->intSubset || real_dom->extSubset) )) {
             xmlFreeDoc(real_dom);
             RETVAL = &PL_sv_undef ;  
             croak(SvPV(LibXML_error, len));
         sv_setref_pv( docfrag_sv, "XML::LibXML::DocumentFragment", (void*)dfProxy );
         dfProxy->extra = docfrag_sv;
         # warn( "NEW FRAGMENT ELEMNT (%s)", name);
-        # SvREFCNT_inc(docfrag_sv);    
+        //# SvREFCNT_inc(docfrag_sv);    
 
         # warn("xmlNewNode\n");
         if ( TEST_PERL_FLAG("XML::LibXML::ORIGINAL_STRING") ) {