mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
Merged revisions 83864 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83864 | florent.xicluna | 2010-08-09 01:08:41 +0200 (lun., 09 août 2010) | 2 lines Fix xml.etree.ElementInclude to include the tail of the current node. Issue #6231 ........
This commit is contained in:
parent
0fad1c2272
commit
2f1b1ffb1d
3 changed files with 22 additions and 1 deletions
|
|
@ -1259,6 +1259,14 @@ XINCLUDE["C2.xml"] = """\
|
||||||
|
|
||||||
XINCLUDE["count.txt"] = "324387"
|
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"] = """\
|
XINCLUDE["C3.xml"] = """\
|
||||||
<?xml version='1.0'?>
|
<?xml version='1.0'?>
|
||||||
<document xmlns:xi="http://www.w3.org/2001/XInclude">
|
<document xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||||
|
|
@ -1334,6 +1342,16 @@ def xinclude():
|
||||||
324387 times.</p>
|
324387 times.</p>
|
||||||
</document>
|
</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)
|
Textual inclusion of XML example (XInclude C.3)
|
||||||
|
|
||||||
>>> document = xinclude_loader("C3.xml")
|
>>> document = xinclude_loader("C3.xml")
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ def include(elem, loader=None):
|
||||||
)
|
)
|
||||||
if i:
|
if i:
|
||||||
node = elem[i-1]
|
node = elem[i-1]
|
||||||
node.tail = (node.tail or "") + text
|
node.tail = (node.tail or "") + text + (e.tail or "")
|
||||||
else:
|
else:
|
||||||
elem.text = (elem.text or "") + text + (e.tail or "")
|
elem.text = (elem.text or "") + text + (e.tail or "")
|
||||||
del elem[i]
|
del elem[i]
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #6231: Fix xml.etree.ElementInclude to include the tail of the
|
||||||
|
current node.
|
||||||
|
|
||||||
- Issue #6869: Fix a refcount problem in the _ctypes extension.
|
- Issue #6869: Fix a refcount problem in the _ctypes extension.
|
||||||
|
|
||||||
- Issue5504 - ctypes should now work with systems where mmap can't be
|
- Issue5504 - ctypes should now work with systems where mmap can't be
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue