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
0bd22d42
Commit
0bd22d42
authored
Apr 03, 2014
by
Eli Bendersky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20375: Clarify ET's parsing of comments and processing instructions.
Based on patch by Nikolaus Rath.
parent
e331121e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
Doc/library/xml.etree.elementtree.rst
Doc/library/xml.etree.elementtree.rst
+22
-0
No files found.
Doc/library/xml.etree.elementtree.rst
View file @
0bd22d42
...
...
@@ -106,6 +106,19 @@ Children are nested, and we can access specific child nodes by index::
'2008'
.. note::
Not all elements of the XML input will end up as elements of the
parsed tree. Currently, this module skips over any XML comments,
processing instructions, and document type declarations in the
input. Nevertheless, trees built using this module's API rather
than parsing from XML text can have comments and processing
instructions in them; they will be included when generating XML
output. A document type declaration may be accessed by passing a
custom :class:`TreeBuilder` instance to the :class:`XMLParser`
constructor.
.. _elementtree-pull-parsing:
Pull API for non-blocking parsing
...
...
@@ -381,6 +394,10 @@ Functions
string containing the comment string. Returns an element instance
representing a comment.
Note that :class:`XMLParser` skips over comments in the input
instead of creating comment objects for them. An :class:`ElementTree` will
only contain comment nodes if they have been inserted into to
the tree using one of the :class:`Element` methods.
.. function:: dump(elem)
...
...
@@ -461,6 +478,11 @@ Functions
containing the PI target. *text* is a string containing the PI contents, if
given. Returns an 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
:class:`ElementTree` will only contain processing instruction nodes if
they have been inserted into to the tree using one of the
:class:`Element` methods.
.. function:: register_namespace(prefix, uri)
...
...
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