Commits

Anonymous committed d063313

Modified Files:
Makefile.PL
+ some comments

Changes
+ more version notes

LibXML.xs
+ fixed error handling (fixes petr pajas' bug report)

  • Participants
  • Parent commits 68eabaf

Comments (0)

Files changed (3)

 1.54
    - Catalog interface is aware about libxml2 configuration
    - XML::LibXML should work now on system without having zlib installed (?)
+   - cleaned the error handling code, which 
+     - fixes bad reporting of the validating parser
+     - fixes bad reporting in xpath functions
    - fixed memory management problem introduced in 1.53
+     (that fixes a lot strange things)
    - fixed default iterator of XML::LibXML::Iterator
    - interface for raw libxml2 DOM building functions 
      (currently just addChild(), others will follow)
-   - fixed bad behaviour of the validating parser
    - fixed memory leak in push parser code
    - fixed namespace handling if nodes are imported to a new DOM.
    - fixed segmentation fault during validation under libxml2 2.4.25
 static SV * LibXML_error    = NULL;
 
 #define LibXML_init_error() LibXML_error = NEWSV(0, 512); \
-                            sv_setpvn(LibXML_error, "", 0);
+                            sv_setpvn(LibXML_error, "", 0); \
+                            xmlSetGenericErrorFunc( NULL ,  \
+                                (xmlGenericErrorFunc)LibXML_error_handler);
 
 #define LibXML_croak_error() if ( SvCUR( LibXML_error ) > 0 ) { \
                                  croak("%s",SvPV(LibXML_error, len)); \
         SV * RETVAL  = NULL; /* dummy for the stupid macro */
 
         LibXML_init_error();
-        xmlSetGenericErrorFunc( NULL , 
-                                (xmlGenericErrorFunc)LibXML_error_handler);
 
         item = hv_fetch( real_obj, "XML_LIBXML_VALIDATION", 21, 0 );
         if ( item != NULL && SvTRUE(*item) ) {  
                 xmlFree(xpath);
             croak( "empty XPath found" );
             XSRETURN_UNDEF;
-        }
+        }   
     PPCODE:
         if ( node->doc ) {
             domNodeNormalize( xmlDocGetRootElement(node->doc ) );
 
 my %config;
 
+
+# maybe i am doing something wrong here, but on my system parse_fh()
+# refuses to work correctly with libxml2 versions below 2.4.25 :|
+# (without even a code change at that level)
+# someone else should run tests with this package, since i can't 
+# trigger this problem. 
 my ( $lib_major, $lib_minor, $lib_patch ) = (2, 4, 20);
+# uncomment for release?
+# my ( $lib_major, $lib_minor, $lib_patch ) = (2, 4, 25);
 
 while($_ = shift) {
     my ($key, $val) = split(/=/, $_, 2);
 
 
 if ($config{LIBS} !~ /\-lxml2\b/) {
-    $config{LIBS} .= $is_Win32 ? ' -llibxml2' : ' -lxml2';
+    # in this case we are not able to run xml2-config. therefore we need to
+    # expand the libz as well.
+    $config{LIBS} .= $is_Win32 ? ' -llibxml2 -lzlib' : ' -lxml2 -lz';
 }
 
 if ($config{LIBS} !~ /\-lz\b/) {
-    $config{LIBS} .= $is_Win32 ? ' -lzlib' :' -lz';
+    # note if libxml2 has not -lz within its cflags, we should not use
+    # it! We should trust libxml2 and assume libz is not available on the
+    # current system (this is ofcourse not true with win32 systems.
+    # $config{LIBS} .= $is_Win32 ? ' -lzlib' :' -lz';
+    if ( $config{DEBUG} ) {
+        warn "zlib was not configured\n";
+        warn "set zlib\n" if $is_Win32;
+    }
+    $config{LIBS} .= $is_Win32 ? ' -lzlib' :'';
 }
 
 if ($config{LIBS} !~ /\-lm\b/) {