diff -r 262204877004 Lib/test/test_xml_etree.py --- a/Lib/test/test_xml_etree.py Mon Apr 14 11:20:45 2014 -0400 +++ b/Lib/test/test_xml_etree.py Wed Apr 16 16:04:45 2014 -0400 @@ -1185,6 +1185,27 @@ """.format(html.escape(SIMPLE_XMLFILE, True)) +XINCLUDE["Recursive1.xml"] = """\ + + +

The following is the source of Recursive2.xml:

+ +
+""" + +XINCLUDE["Recursive2.xml"] = """\ + + +

The following is the source of Recursive3.xml:

+ +
+""" + +XINCLUDE["Recursive3.xml"] = """\ + +

This is all there is in Recursive3.xml

+""" + # # badly formatted xi:include tags @@ -1306,6 +1327,21 @@ ' \n' '') # C5 + + # Textual inclusion of recursive element + document = self.xinclude_loader("Recursive1.xml") + ElementInclude.include(document, self.xinclude_loader) + print('\n',serialize(document)) + self.assertEqual(serialize(document), + '\n' + '

The following is the source of Recursive2.xml:

\n' + ' \n' + '

The following is the source of Recursive3.xml:

\n' + '

This is all there is in Recursive3.xml

\n' + '
\n' + '
') + + def test_xinclude_failures(self): from xml.etree import ElementInclude diff -r 262204877004 Lib/xml/etree/ElementInclude.py --- a/Lib/xml/etree/ElementInclude.py Mon Apr 14 11:20:45 2014 -0400 +++ b/Lib/xml/etree/ElementInclude.py Wed Apr 16 16:04:45 2014 -0400 @@ -114,6 +114,7 @@ "cannot load %r as %r" % (href, parse) ) node = copy.copy(node) + include(node,loader) if e.tail: node.tail = (node.tail or "") + e.tail elem[i] = node