summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2022-10-23 17:52:29 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2022-10-25 19:34:38 +0200
commit20e2fb4c1cee1a5d8236c18b96fe6a3038c9ffb5 (patch)
treed6e3ef4fef5beedbd176d875b58b0a50be4d7125 /test
parent010b682feef776290e53357ee716092966b052fe (diff)
downloadlibxml2-20e2fb4c1cee1a5d8236c18b96fe6a3038c9ffb5.tar.gz
xinclude: Avoid creation of subcontexts
Don't create subcontext in xmlXIncludeRecurseDoc. Save and restore 'doc' and 'incTab' instead. Make xmlXIncludeLoadFallback call xmlXIncludeCopyNode which seems safer than xmlXIncludeDoProcess since the latter may modify the document. This should also be more performant since we need to copy the whole fallback subtree anyway. Also make sure to avoid replacements in fallback elements in xmlXIncludeDoProcess.
Diffstat (limited to 'test')
-rw-r--r--test/XInclude/without-reader/fallback7.xml12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/XInclude/without-reader/fallback7.xml b/test/XInclude/without-reader/fallback7.xml
new file mode 100644
index 00000000..7ddf9366
--- /dev/null
+++ b/test/XInclude/without-reader/fallback7.xml
@@ -0,0 +1,12 @@
+<x xmlns:xi="http://www.w3.org/2001/XInclude">
+ <a>text</a>
+ <xi:include xpointer="xpointer(//b)"/>
+ <xi:include href="404.xml">
+ <xi:fallback>
+ <b>
+ <xi:include xpointer="xpointer(//a)"/>
+ </b>
+ </xi:fallback>
+ </xi:include>
+ <xi:include xpointer="xpointer(//b)"/>
+</x>