diff --git a/result/XInclude/fallback8.xml b/result/XInclude/fallback8.xml new file mode 100644 index 00000000..1b2508f8 --- /dev/null +++ b/result/XInclude/fallback8.xml @@ -0,0 +1,4 @@ + + + text not found + diff --git a/result/XInclude/fallback8.xml.err b/result/XInclude/fallback8.xml.err new file mode 100644 index 00000000..4327677f --- /dev/null +++ b/result/XInclude/fallback8.xml.err @@ -0,0 +1 @@ +I/O warning : failed to load "test/XInclude/docs/404.txt": No such file or directory diff --git a/result/XInclude/fallback8.xml.rdr b/result/XInclude/fallback8.xml.rdr new file mode 100644 index 00000000..f99d17e8 --- /dev/null +++ b/result/XInclude/fallback8.xml.rdr @@ -0,0 +1,7 @@ +0 1 doc 0 0 +1 14 #text 0 1 + +1 3 #text 0 1 text not found +1 14 #text 0 1 + +0 15 doc 0 0 diff --git a/test/XInclude/docs/fallback8.xml b/test/XInclude/docs/fallback8.xml new file mode 100644 index 00000000..102ccfc0 --- /dev/null +++ b/test/XInclude/docs/fallback8.xml @@ -0,0 +1,7 @@ + + + + text not found + + + diff --git a/xinclude.c b/xinclude.c index 68beb366..d4a40712 100644 --- a/xinclude.c +++ b/xinclude.c @@ -1410,9 +1410,14 @@ xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) { inputStream = xmlLoadResource(pctxt, (const char*) url, NULL, XML_RESOURCE_XINCLUDE_TEXT); if (inputStream == NULL) { + /* + * ENOENT only produces a warning which isn't reflected in errNo. + */ if (pctxt->errNo == XML_ERR_NO_MEMORY) xmlXIncludeErrMemory(ctxt); - else + else if ((pctxt->errNo != XML_ERR_OK) && + (pctxt->errNo != XML_IO_ENOENT) && + (pctxt->errNo != XML_IO_UNKNOWN)) xmlXIncludeErr(ctxt, NULL, pctxt->errNo, "load error", NULL); goto error; }