mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Fix xml.etree.ElementInclude to include the tail of the current node. Issue #6231
This commit is contained in:
parent
14bd1c3b2e
commit
ba8a98600e
3 changed files with 22 additions and 1 deletions
|
|
@ -1277,6 +1277,14 @@ XINCLUDE["C2.xml"] = """\
|
|||
|
||||
XINCLUDE["count.txt"] = "324387"
|
||||
|
||||
XINCLUDE["C2b.xml"] = """\
|
||||
<?xml version='1.0'?>
|
||||
<document xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<p>This document has been <em>accessed</em>
|
||||
<xi:include href="count.txt" parse="text"/> times.</p>
|
||||
</document>
|
||||
"""
|
||||
|
||||
XINCLUDE["C3.xml"] = """\
|
||||
<?xml version='1.0'?>
|
||||
<document xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
|
@ -1352,6 +1360,16 @@ def xinclude():
|
|||
324387 times.</p>
|
||||
</document>
|
||||
|
||||
Textual inclusion after sibling element (based on modified XInclude C.2)
|
||||
|
||||
>>> document = xinclude_loader("C2b.xml")
|
||||
>>> ElementInclude.include(document, xinclude_loader)
|
||||
>>> print(serialize(document)) # C2b
|
||||
<document>
|
||||
<p>This document has been <em>accessed</em>
|
||||
324387 times.</p>
|
||||
</document>
|
||||
|
||||
Textual inclusion of XML example (XInclude C.3)
|
||||
|
||||
>>> document = xinclude_loader("C3.xml")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue