Re: [xml] libxml2 Solaris issue



What about this one? It again worked for me in both cases.

Thanks,

Petr

--- libxml2-2.6.30/uri.c.orig   Tue Nov 20 01:44:59 2007
+++ libxml2-2.6.30/uri.c        Tue Nov 20 01:45:29 2007
@@ -2418,6 +2418,12 @@

     if (path == NULL)
        return(NULL);
+
+    /* sanitize filename starting with // so it can be used as URI */
+    if (strlen(path) > 2 && path[0]=='/'
+        && path[1]=='/' && path[2]!='/')
+       path++;
+
     if ((uri = xmlParseURI((const char *) path)) != NULL) {
        xmlFreeURI(uri);
        return xmlStrdup(path);


Daniel Veillard wrote:
On Thu, Nov 08, 2007 at 05:54:27PM +0100, Petr Sumbera wrote:
Thanks for looking at it.

Daniel Veillard wrote:
On Thu, Nov 08, 2007 at 01:33:02PM +0100, Petr Sumbera wrote:
 Looks completely the wrong place to do this kind of changes.
You just can't hack every single entry point in the library which
may take a filename. What you need to understand and check is why //foo/bar isn't recognized as a legal filename, as far as I can
It's little bit different problem. //foo/bar is recognized as file. Problem is that path to DTD file which is stated in //foo/bar XML file (e.g. /foo2/dtd) is wrongly processed to //foo/foo2/dtd.

xmlNoNetExists() receives already wrong path (//foo/foo2/dtd).

Any idea?

  You misunderstood. //foo/bar should be converted to /foo/bar
by the path canonicalization routine when the //foo/bar document is loaded.

Daniel





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