Index: Lib/test/test_xml_etree.py =================================================================== --- Lib/test/test_xml_etree.py (revision 73267) +++ Lib/test/test_xml_etree.py (working copy) @@ -243,6 +243,14 @@ XINCLUDE["count.txt"] = "324387" +XINCLUDE["C2b.xml"] = """\ + + +

This document has been accessed + times.

+
+""" + XINCLUDE["C3.xml"] = """\ @@ -318,6 +326,16 @@ 324387 times.

+ Textual inclusion after sibling element (based on modified XInclude C.2) + + >>> document = xinclude_loader("C2b.xml") + >>> ElementInclude.include(document, xinclude_loader) + >>> print(serialize(ET, document)) # C2b + +

This document has been accessed + 324387 times.

+
+ Textual inclusion of XML example (XInclude C.3) >>> document = xinclude_loader("C3.xml") Index: Lib/xml/etree/ElementInclude.py =================================================================== --- Lib/xml/etree/ElementInclude.py (revision 73267) +++ Lib/xml/etree/ElementInclude.py (working copy) @@ -125,7 +125,7 @@ ) if i: node = elem[i-1] - node.tail = (node.tail or "") + text + node.tail = (node.tail or "") + text + (e.tail or "") else: elem.text = (elem.text or "") + text + (e.tail or "") del elem[i]