diff --git a/result/XInclude/coalesce.xml.rdr b/result/XInclude/coalesce.xml.rdr new file mode 100644 index 00000000..95a32aa1 --- /dev/null +++ b/result/XInclude/coalesce.xml.rdr @@ -0,0 +1,17 @@ +0 1 test 0 0 +1 14 #text 0 1 + +1 1 t1 0 0 +2 3 #text 0 1 + start + +2 3 #text 0 1 + start + +2 3 #text 0 1 + end + +1 15 t1 0 0 +1 14 #text 0 1 + +0 15 test 0 0 diff --git a/result/XInclude/nodes.xml.rdr b/result/XInclude/nodes.xml.rdr new file mode 100644 index 00000000..0e538781 --- /dev/null +++ b/result/XInclude/nodes.xml.rdr @@ -0,0 +1,18 @@ +0 1 x 0 0 +1 14 #text 0 1 + +1 8 #comment 0 1 Simple test of including a set of nodes from an XML document +1 14 #text 0 1 + +1 1 p 0 0 +2 3 #text 0 1 something +1 15 p 0 0 +1 1 p 0 0 +2 3 #text 0 1 really +1 15 p 0 0 +1 1 p 0 0 +2 3 #text 0 1 simple +1 15 p 0 0 +1 14 #text 0 1 + +0 15 x 0 0 diff --git a/result/XInclude/nodes2.xml.rdr b/result/XInclude/nodes2.xml.rdr new file mode 100644 index 00000000..0e538781 --- /dev/null +++ b/result/XInclude/nodes2.xml.rdr @@ -0,0 +1,18 @@ +0 1 x 0 0 +1 14 #text 0 1 + +1 8 #comment 0 1 Simple test of including a set of nodes from an XML document +1 14 #text 0 1 + +1 1 p 0 0 +2 3 #text 0 1 something +1 15 p 0 0 +1 1 p 0 0 +2 3 #text 0 1 really +1 15 p 0 0 +1 1 p 0 0 +2 3 #text 0 1 simple +1 15 p 0 0 +1 14 #text 0 1 + +0 15 x 0 0 diff --git a/result/XInclude/nodes3.xml.err b/result/XInclude/nodes3.xml.err index dbe73eb5..fb115253 100644 --- a/result/XInclude/nodes3.xml.err +++ b/result/XInclude/nodes3.xml.err @@ -1 +1 @@ -./test/XInclude/without-reader/nodes3.xml:3: element include: XInclude error : Invalid fragment identifier in URI test/XInclude/ents/something.xml#xpointer(//p) use the xpointer attribute +./test/XInclude/docs/nodes3.xml:3: element include: XInclude error : Invalid fragment identifier in URI test/XInclude/ents/something.xml#xpointer(//p) use the xpointer attribute diff --git a/result/XInclude/red.xml.rdr b/result/XInclude/red.xml.rdr new file mode 100644 index 00000000..de332dbc --- /dev/null +++ b/result/XInclude/red.xml.rdr @@ -0,0 +1,26 @@ +0 1 book 0 0 +1 14 #text 0 1 + +1 1 chapter 0 0 +2 14 #text 0 1 + +2 1 para 0 0 +3 3 #text 0 1 Introduction +2 15 para 0 0 +2 14 #text 0 1 + +1 15 chapter 0 0 +1 14 #text 0 1 + +1 1 chapter 0 0 +2 14 #text 0 1 + +2 1 para 0 0 +3 3 #text 0 1 Introduction +2 15 para 0 0 +2 14 #text 0 1 + +1 15 chapter 0 0 +1 14 #text 0 1 + +0 15 book 0 0 diff --git a/test/XInclude/without-reader/coalesce.xml b/test/XInclude/docs/coalesce.xml similarity index 100% rename from test/XInclude/without-reader/coalesce.xml rename to test/XInclude/docs/coalesce.xml diff --git a/test/XInclude/without-reader/nodes.xml b/test/XInclude/docs/nodes.xml similarity index 100% rename from test/XInclude/without-reader/nodes.xml rename to test/XInclude/docs/nodes.xml diff --git a/test/XInclude/without-reader/nodes2.xml b/test/XInclude/docs/nodes2.xml similarity index 100% rename from test/XInclude/without-reader/nodes2.xml rename to test/XInclude/docs/nodes2.xml diff --git a/test/XInclude/without-reader/nodes3.xml b/test/XInclude/docs/nodes3.xml similarity index 100% rename from test/XInclude/without-reader/nodes3.xml rename to test/XInclude/docs/nodes3.xml diff --git a/test/XInclude/without-reader/red.xml b/test/XInclude/docs/red.xml similarity index 100% rename from test/XInclude/without-reader/red.xml rename to test/XInclude/docs/red.xml diff --git a/xinclude.c b/xinclude.c index d909f33b..901edc9a 100644 --- a/xinclude.c +++ b/xinclude.c @@ -603,17 +603,19 @@ xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, const xmlURL url ATTRIBUTE_UNUSED) { xmlDocPtr oldDoc; xmlXIncludeRefPtr *oldIncTab; - int oldIncMax, oldIncNr; + int oldIncMax, oldIncNr, oldIsStream; int i; oldDoc = ctxt->doc; oldIncMax = ctxt->incMax; oldIncNr = ctxt->incNr; oldIncTab = ctxt->incTab; + oldIsStream = ctxt->isStream; ctxt->doc = doc; ctxt->incMax = 0; ctxt->incNr = 0; ctxt->incTab = NULL; + ctxt->isStream = 0; xmlXIncludeDoProcess(ctxt, xmlDocGetRootElement(doc)); @@ -627,6 +629,7 @@ xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, ctxt->incMax = oldIncMax; ctxt->incNr = oldIncNr; ctxt->incTab = oldIncTab; + ctxt->isStream = oldIsStream; } /************************************************************************ @@ -1409,7 +1412,7 @@ loaded: xmlXPathContextPtr xptrctxt; xmlNodeSetPtr set; - if (ctxt->isStream) { + if (ctxt->isStream && doc == ctxt->doc) { xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_XPTR_FAILED, "XPointer expressions not allowed in streaming" " mode\n", NULL);