Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
0bd22d42
Kaydet (Commit)
0bd22d42
authored
Nis 03, 2014
tarafından
Eli Bendersky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #20375: Clarify ET's parsing of comments and processing instructions.
Based on patch by Nikolaus Rath.
üst
e331121e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
xml.etree.elementtree.rst
Doc/library/xml.etree.elementtree.rst
+22
-0
No files found.
Doc/library/xml.etree.elementtree.rst
Dosyayı görüntüle @
0bd22d42
...
@@ -106,6 +106,19 @@ Children are nested, and we can access specific child nodes by index::
...
@@ -106,6 +106,19 @@ Children are nested, and we can access specific child nodes by index::
'2008'
'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:
.. _elementtree-pull-parsing:
Pull API for non-blocking parsing
Pull API for non-blocking parsing
...
@@ -381,6 +394,10 @@ Functions
...
@@ -381,6 +394,10 @@ Functions
string containing the comment string. Returns an element instance
string containing the comment string. Returns an element instance
representing a comment.
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)
.. function:: dump(elem)
...
@@ -461,6 +478,11 @@ Functions
...
@@ -461,6 +478,11 @@ Functions
containing the PI target. *text* is a string containing the PI contents, if
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 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)
.. 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