mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-24 21:33:51 +03:00
xinclude: Always allow XPtr expressions in external documents
This commit is contained in:
parent
f14529baf5
commit
b456e3bb42
17
result/XInclude/coalesce.xml.rdr
Normal file
17
result/XInclude/coalesce.xml.rdr
Normal file
@ -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
|
18
result/XInclude/nodes.xml.rdr
Normal file
18
result/XInclude/nodes.xml.rdr
Normal file
@ -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
|
18
result/XInclude/nodes2.xml.rdr
Normal file
18
result/XInclude/nodes2.xml.rdr
Normal file
@ -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
|
@ -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
|
||||
|
26
result/XInclude/red.xml.rdr
Normal file
26
result/XInclude/red.xml.rdr
Normal file
@ -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
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user