diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst index 99d7e8b..719121f 100644 --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -466,7 +466,7 @@ Functions Comment element factory. This factory function creates a special element that will be serialized as an XML comment by the standard serializer. The comment string can be either a bytestring or a Unicode string. *text* is a - string containing the comment string. Returns an element instance + string containing the comment string. Returns an :class:`Element` instance representing a comment. Note that :class:`XMLParser` skips over comments in the input @@ -504,7 +504,7 @@ Functions .. function:: iselement(element) Checks if an object appears to be a valid element object. *element* is an - element instance. Returns a true value if this is an element object. + :class:`Element` instance. Returns a true value if this is an element object. .. function:: iterparse(source, events=None, parser=None) @@ -551,7 +551,7 @@ Functions PI element factory. This factory function creates a special element that will be serialized as an XML processing instruction. *target* is a string containing the PI target. *text* is a string containing the PI contents, if - given. Returns an element instance, representing a processing instruction. + given. Returns an :class:`Element` instance, representing a processing instruction. Note that :class:`XMLParser` skips over processing instructions in the input instead of creating comment objects for them. An @@ -572,14 +572,14 @@ Functions .. function:: SubElement(parent, tag, attrib={}, **extra) - Subelement factory. This function creates an element instance, and appends + Subelement factory. This function creates an :class:`Element` instance, and appends it to an existing element. The element name, attribute names, and attribute values can be either bytestrings or Unicode strings. *parent* is the parent element. *tag* is the subelement name. *attrib* is an optional dictionary, containing element attributes. *extra* contains additional attributes, given as keyword - arguments. Returns an element instance. + arguments. Returns an :class:`Element` instance. .. function:: tostring(element, encoding="us-ascii", method="xml", *, \ @@ -742,7 +742,7 @@ Element Objects .. method:: find(match, namespaces=None) Finds the first subelement matching *match*. *match* may be a tag name - or a :ref:`path `. Returns an element instance + or a :ref:`path `. Returns an :class:`Element` instance or ``None``. *namespaces* is an optional mapping from namespace prefix to full name. @@ -863,7 +863,7 @@ ElementTree Objects Replaces the root element for this tree. This discards the current contents of the tree, and replaces it with the given element. Use with - care. *element* is an element instance. + care. *element* is an :class:`Element` instance. .. method:: find(match, namespaces=None) @@ -1001,7 +1001,7 @@ TreeBuilder Objects can use this class to build an element structure using a custom XML parser, or a parser for some other XML-like format. *element_factory*, when given, must be a callable accepting two positional arguments: a tag and - a dict of attributes. It is expected to return a new element instance. + a dict of attributes. It is expected to return a new :class:`Element` instance. .. method:: close()