Re: [xml] configure/compile problem w/o schemas/xpath



Thanks Eric. I wanted to try and put together a more complicated patch than
yours (trying to preserve function definitions) but yours is perfectly
good..

You also need to patch xmllint.c

*** GPTEMP/libxml2-2.5.7/xmllint.c      Mon Apr 21 11:24:29 2003
--- libxml2-2.5.7/xmllint.c     Fri May  9 00:48:29 2003
***************
*** 626,631 ****
--- 626,632 ----
            xmlTextReaderSetParserProp(reader, XML_PARSER_VALIDATE, 1);
        else
            xmlTextReaderSetParserProp(reader, XML_PARSER_LOADDTD, 1);
+ #ifdef LIBXML_SCHEMAS_ENABLED
        if (relaxng != NULL) {
            if (timing) {
                startTimer();
***************
*** 640,645 ****
--- 641,647 ----
                endTimer("Compiling the schemas");
            }
        }
+ #endif
  
        /*
         * Process all nodes in sequence
***************
*** 654,660 ****
--- 656,666 ----
            ret = xmlTextReaderRead(reader);
        }
        if (timing) {
+ #ifdef LIBXML_SCHEMAS_ENABLED
            if ((valid) || (relaxng != NULL))
+ #else
+           if (valid)
+ #endif
                endTimer("Parsing and validating");
            else
                endTimer("Parsing");
***************
*** 667,672 ****
--- 673,679 ----
                progresult = 3;
            }
        }
+ #ifdef LIBXML_SCHEMAS_ENABLED
        if (relaxng != NULL) {
            if (xmlTextReaderIsValid(reader) != 1) {
                printf("%s fails to validate\n", filename);
***************
*** 675,680 ****
--- 682,688 ----
                printf("%s validates\n", filename);
            }
        }
+ #endif
        /*
         * Done, cleanup and status
         */

Gary

On Fri, May 09, 2003 at 10:07:46AM +1000, Eric Zurcher csiro au wrote:
Gary and Joerg,

The required patch to xmlreader.c is very simple. All that is needed are a
couple more conditional defines to exclude a few blocks of code when
LIBXML_SCHEMAS_ENABLED is not defined.

Here's a patch:

Index: xmlreader.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/xmlreader.c,v
retrieving revision 1.47
diff -u -r1.47 xmlreader.c
--- xmlreader.c       30 Apr 2003 12:20:34 -0000      1.47
+++ xmlreader.c       8 May 2003 23:55:33 -0000
@@ -1208,6 +1208,7 @@
 xmlFreeTextReader(xmlTextReaderPtr reader) {
     if (reader == NULL)
      return;
+#ifdef LIBXML_SCHEMAS_ENABLED
     if (reader->rngSchemas != NULL) {
      xmlRelaxNGFree(reader->rngSchemas);
      reader->rngSchemas = NULL;
@@ -1216,6 +1217,7 @@
      xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt);
      reader->rngValidCtxt = NULL;
     }
+#endif
     if (reader->ctxt != NULL) {
      if (reader->ctxt->myDoc != NULL) {
          xmlFreeDoc(reader->ctxt->myDoc);
@@ -2473,6 +2475,7 @@
     return(reader->ctxt->myDoc);
 }
 
+#ifdef LIBXML_SCHEMAS_ENABLED
 /**
  * xmlTextReaderRelaxNGSetSchema:
  * @reader:  the xmlTextReaderPtr used
@@ -2590,6 +2593,7 @@
     reader->validate = XML_TEXTREADER_VALIDATE_RNG;
     return(0);
 }
+#endif
 
 /************************************************************************
  *                                                                   *

Eric Zurcher
CSIRO Livestock Industries
Canberra, Australia
Eric Zurcher csiro au

-----Original Message-----
Date: Thu, 8 May 2003 09:18:18 +0100
From: Gary Pennington sun com
To: Joerg Schmitz-Linneweber <jsl eib-port de>
Cc: XML-List <xml gnome org>
Subject: Re: [xml] configure/compile problem w/o schemas/xpath
Reply-To: Gary Pennington <gary pennington sun com>
Organization: Solaris Kernel Development; Sun Microsystems, Inc.

Coincidentally enough, I also found this out yesterday.

It looks to me like the xmlreader.c file isn't finished. I started working
on adding the required #ifdef support, but it was a big job and I haven't
got time to do it right now.

If I find time I'll submit a patch to the mailing list.

I'm pretty sure you have configured correctly (at least as far as
disabling
schema support is concerned), but you've just encountered some unfinished
work.

Gary


-- 
Gary Pennington
Solaris Kernel Development,
Sun Microsystems
Gary Pennington sun com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]