Index: include/libxml/parser.h =================================================================== --- include/libxml/parser.h (revision 3773) +++ include/libxml/parser.h (working copy) @@ -1093,7 +1093,8 @@ typedef enum { XML_PARSE_COMPACT = 1<<16,/* compact small text nodes; no modification of the tree allowed afterwards (will possibly crash if you try to modify the tree) */ - XML_PARSE_OLD10 = 1<<17 /* parse using XML-1.0 before update 5 */ + XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */ + XML_PARSE_NOBASEFIX = 1<<18 /* do not fixup XINCLUDE xml:base uris */ } xmlParserOption; XMLPUBFUN void XMLCALL Index: xinclude.c =================================================================== --- xinclude.c (revision 3773) +++ xinclude.c (working copy) @@ -1678,7 +1678,9 @@ loaded: /* * Do the xml:base fixup if needed */ - if ((doc != NULL) && (URL != NULL) && (xmlStrchr(URL, (xmlChar) '/'))) { + if ((doc != NULL) && (URL != NULL) && (xmlStrchr(URL, (xmlChar) '/')) && + (!(ctxt->parseFlags & XML_PARSE_NOBASEFIX)) && + (!(doc->parseFlags & XML_PARSE_NOBASEFIX))) { xmlNodePtr node; xmlChar *base; xmlChar *curBase; Index: xmllint.c =================================================================== --- xmllint.c (revision 3773) +++ xmllint.c (working copy) @@ -2891,6 +2891,7 @@ static void usage(const char *name) { #ifdef LIBXML_XINCLUDE_ENABLED printf("\t--xinclude : do XInclude processing\n"); printf("\t--noxincludenode : same but do not generate XInclude nodes\n"); + printf("\t--nofixup-base-uris : do not fixup xml:base uris\n"); #endif printf("\t--loaddtd : fetch external DTD\n"); printf("\t--dtdattr : loaddtd + populate the tree with inherited attributes \n"); @@ -3093,6 +3094,12 @@ main(int argc, char **argv) { options |= XML_PARSE_XINCLUDE; options |= XML_PARSE_NOXINCNODE; } + else if ((!strcmp(argv[i], "-nofixup-base-uris")) || + (!strcmp(argv[i], "--nofixup-base-uris"))) { + xinclude++; + options |= XML_PARSE_XINCLUDE; + options |= XML_PARSE_NOBASEFIX; + } #endif #ifdef LIBXML_OUTPUT_ENABLED #ifdef HAVE_ZLIB_H