GNOME Bugzilla – Bug 59427
Add capability to use catalogs with --nonet option for xsltproc.
Last modified: 2009-08-15 18:40:50 UTC
A xsltproc program which is included in libxslt distribution cannot handle catalog files with --nonet option. This patch add capability to use catalogs even if --nonet option is specified. --- xsltproc/xsltproc.c.orig Tue Jul 24 06:48:24 2001 +++ xsltproc/xsltproc.c Thu Aug 23 21:18:07 2001 @@ -78,12 +78,20 @@ static xmlParserInputPtr xsltNoNetExternalEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt) { - if (URL != NULL) { - if ((!xmlStrncasecmp((const xmlChar *) URL, + const xmlChar *resource = NULL; + +#ifdef LIBXML_CATALOG_ENABLED + if (ID != NULL) + resource = xmlCatalogGetPublic((const xmlChar *)ID); + if ((resource == NULL) && (URL != NULL)) + resource = xmlCatalogGetSystem((const xmlChar *)URL); +#endif + if (resource != NULL) { + if ((!xmlStrncasecmp((const xmlChar *) resource, (const xmlChar *) "ftp://", 6)) || - (!xmlStrncasecmp((const xmlChar *) URL, + (!xmlStrncasecmp((const xmlChar *) resource, (const xmlChar *) "http://", 7))) { - fprintf(stderr, "Attempt to load network entity %s \n", URL); + fprintf(stderr, "Attempt to load network entity %s \n", resource); if (nonet) return(NULL); }
Well, thanks for the patch, I'm working on this and it's a bit more complex than what you suggested :-) I will definitely try to get the whole catalog thing sorted for the next release, I think we are tryng to reach the same goal ... thanks again, I hope to have a new set of releases soon, Daniel
Okay I think I have fixed the problem for good in CVS: http://cvs.gnome.org/bonsai/cvsview2.cgi?command=DIFF&subdir=libxslt%2Fxsltproc&file=xsltproc.c&rev1=1.8&rev2=1.9&whitespace_mode=show&diff_mode=context This is tightly dependant on recent commits done in the libxml module since the release is not far away, I suggest to wait for it :-) Daniel
Should be fixed in the latest 1.0.3/2.4.3 releases, thanks, Daniel