From e3c958c33badaff340ee8dcf2c5f64aaa87ffda4 Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Mon, 1 May 2006 12:45:02 +0000 Subject: [PATCH] Some ElementTree fixes: import from xml, not xmlcore; fix case of module name; mention list() instead of getchildren() --- Doc/whatsnew/whatsnew25.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Doc/whatsnew/whatsnew25.tex b/Doc/whatsnew/whatsnew25.tex index f8ab1bce8b8..df7e23f6b55 100644 --- a/Doc/whatsnew/whatsnew25.tex +++ b/Doc/whatsnew/whatsnew25.tex @@ -1633,7 +1633,7 @@ of extension modules, now that \module{ctypes} is included with core Python. \subsection{The ElementTree package\label{module-etree}} A subset of Fredrik Lundh's ElementTree library for processing XML has -been added to the standard library as \module{xmlcore.etree}. The +been added to the standard library as \module{xml.etree}. The available modules are \module{ElementTree}, \module{ElementPath}, and \module{ElementInclude} from ElementTree 1.2.6. @@ -1655,7 +1655,7 @@ takes either a string (assumed to contain a filename) or a file-like object and returns an \class{ElementTree} instance: \begin{verbatim} -from xmlcore.etree import ElementTree as ET +from xml.etree import ElementTree as ET tree = ET.parse('ex-1.xml') @@ -1673,7 +1673,7 @@ This function provides a tidy way to incorporate XML fragments, approaching the convenience of an XML literal: \begin{verbatim} -svg = et.XML(""" +svg = ET.XML(""" """) svg.set('height', '320px') svg.append(elem1) @@ -1687,7 +1687,7 @@ values, and list-like operations are used to access child nodes. \lineii{elem[n]}{Returns n'th child element.} \lineii{elem[m:n]}{Returns list of m'th through n'th child elements.} \lineii{len(elem)}{Returns number of child elements.} - \lineii{elem.getchildren()}{Returns list of child elements.} + \lineii{list(elem)}{Returns list of child elements.} \lineii{elem.append(elem2)}{Adds \var{elem2} as a child.} \lineii{elem.insert(index, elem2)}{Inserts \var{elem2} at the specified location.} \lineii{del elem[n]}{Deletes n'th child element.} @@ -2096,7 +2096,7 @@ freed with the corresponding family's \cfunction{*_Free()} function. The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Phillip J. Eby, Kent Johnson, Martin von~L\"owis, Gustavo -Niemeyer, James Pryor, Mike Rovner, Thomas Wouters. +article: Phillip J. Eby, Kent Johnson, Martin von~L\"owis, Fredrik Lundh, +Gustavo Niemeyer, James Pryor, Mike Rovner, Thomas Wouters. \end{document}