Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c020e7f8
Commit
c020e7f8
authored
Aug 25, 2013
by
Eli Bendersky
Browse files
Options
Browse Files
Download
Plain Diff
Merge doc fix from 3.3
parents
74eba65f
bf8ab77f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Doc/library/xml.etree.elementtree.rst
Doc/library/xml.etree.elementtree.rst
+8
-8
No files found.
Doc/library/xml.etree.elementtree.rst
View file @
c020e7f8
...
@@ -983,8 +983,8 @@ XMLParser Objects
...
@@ -983,8 +983,8 @@ XMLParser Objects
.. method:: close()
.. method:: close()
Finishes feeding data to the parser. Returns the result of calling the
Finishes feeding data to the parser. Returns the result of calling the
:meth:`~TreeBuilder.close` method of the *target* passed during
``close()`` method of the *target* passed during construction; by default,
construction; by default,
this is the toplevel document element.
this is the toplevel document element.
.. method:: doctype(name, pubid, system)
.. method:: doctype(name, pubid, system)
...
@@ -998,12 +998,12 @@ XMLParser Objects
...
@@ -998,12 +998,12 @@ XMLParser Objects
Feeds data to the parser. *data* is encoded data.
Feeds data to the parser. *data* is encoded data.
:meth:`XMLParser.feed` calls *target*\'s :meth:`start
` method
:meth:`XMLParser.feed` calls *target*\'s ``start()`
` method
for each opening tag, its :meth:`end
` method for each closing tag,
for each opening tag, its ``end()`
` method for each closing tag,
and data is processed by method :meth:`data
`. :meth:`XMLParser.close`
and data is processed by method ``data()`
`. :meth:`XMLParser.close`
calls *target*\'s method :meth:`close
`.
calls *target*\'s method ``close()`
`.
:class:`XMLParser` can be used not only for building a tree structure.
:class:`XMLParser` can be used not only for building a tree structure.
This is an example of counting the maximum depth of an XML file::
This is an example of counting the maximum depth of an XML file::
>>> from xml.etree.ElementTree import XMLParser
>>> from xml.etree.ElementTree import XMLParser
>>> class MaxDepth: # The target object of the parser
>>> class MaxDepth: # The target object of the parser
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment