1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

Fix regression introduced with commit 74dcc10b

The code wasn't dead after all, but I can see no reason in delaying
the XPointer evaluation. This could lead to nodes included earlier
appearing in XPointer results.
This commit is contained in:
Nick Wellnhofer
2020-08-19 13:52:08 +02:00
parent fbb7fa9a9a
commit 87d20b554c
4 changed files with 46 additions and 1 deletions

10
result/XInclude/ns1.xml Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<doc xmlns:xi="http://www.w3.org/2001/XInclude">
<ns:elem xmlns:ns="urn:foo" xml:id="a"/>
<elem xmlns:ns="urn:foo">
<ns:elem xml:id="a"/>
</elem>
<ns:elem xmlns:ns="urn:bar"/>
</doc>

View File

@@ -0,0 +1,23 @@
0 1 doc 0 0
1 14 #text 0 1
1 1 ns:elem 1 0
1 14 #text 0 1
1 1 elem 0 0
2 14 #text 0 1
2 1 ns:elem 1 0
2 14 #text 0 1
1 15 elem 0 0
1 14 #text 0 1
1 14 #text 0 1
1 1 ns:elem 1 0
1 14 #text 0 1
1 14 #text 0 1
0 15 doc 0 0

View File

@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<doc xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="#a"/>
<elem xmlns:ns="urn:foo">
<ns:elem xml:id="a"/>
</elem>
<xi:include href="b.xml">
<xi:fallback xmlns:ns="urn:bar">
<ns:elem/>
</xi:fallback>
</xi:include>
</doc>

View File

@@ -1464,7 +1464,7 @@ xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) {
*/ */
if ((URL[0] == 0) || (URL[0] == '#') || if ((URL[0] == 0) || (URL[0] == '#') ||
((ctxt->doc != NULL) && (xmlStrEqual(URL, ctxt->doc->URL)))) { ((ctxt->doc != NULL) && (xmlStrEqual(URL, ctxt->doc->URL)))) {
doc = NULL; doc = ctxt->doc;
goto loaded; goto loaded;
} }