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
88db6f40
Kaydet (Commit)
88db6f40
authored
Mar 14, 2010
tarafından
Florent Xicluna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Minor documentation updates for xml.etree.
üst
02b3f0ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
xml.etree.elementtree.rst
Doc/library/xml.etree.elementtree.rst
+14
-12
test_xml_etree.py
Lib/test/test_xml_etree.py
+2
-2
No files found.
Doc/library/xml.etree.elementtree.rst
Dosyayı görüntüle @
88db6f40
...
...
@@ -72,8 +72,8 @@ Functions
.. function:: fromstring(text)
Parses an XML section from a string constant. Same as
XML. *text* is a
string containing XML data. Returns an :class:`Element` instance.
Parses an XML section from a string constant. Same as
:func:`XML`. *text*
is a
string containing XML data. Returns an :class:`Element` instance.
.. function:: fromstringlist(sequence, parser=None)
...
...
@@ -139,7 +139,7 @@ Functions
.. versionadded:: 2.7
.. function:: SubElement(parent, tag, attrib={},
**extra)
.. function:: SubElement(parent, tag, attrib={}, **extra)
Subelement factory. This function creates an element instance, and appends
it to an existing element.
...
...
@@ -151,22 +151,24 @@ Functions
arguments. Returns an element instance.
.. function:: tostring(element, encoding=
None, method=None
)
.. function:: tostring(element, encoding=
"us-ascii", method="xml"
)
Generates a string representation of an XML element, including all
subelements. *element* is an :class:`Element` instance. *encoding*
is the
output encoding (default is US-ASCII). *method* is either ``"xml"``,
subelements. *element* is an :class:`Element` instance. *encoding*
[1]_ is
the
output encoding (default is US-ASCII). *method* is either ``"xml"``,
``"html"`` or ``"text"`` (default is ``"xml"``). Returns an encoded string
containing the XML data.
.. function:: tostringlist(element, encoding=
None, method=None
)
.. function:: tostringlist(element, encoding=
"us-ascii", method="xml"
)
Generates a string representation of an XML element, including all
subelements. *element* is an :class:`Element` instance. *encoding* is the
output encoding (default is US-ASCII). *method* is either ``"xml"``,
``"html"`` or ``"text"`` (default is ``"xml"``). Returns a sequence object
containing the XML data.
subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is
the output encoding (default is US-ASCII). *method* is either ``"xml"``,
``"html"`` or ``"text"`` (default is ``"xml"``). Returns a list of encoded
strings containing the XML data. It does not guarantee any specific
sequence, except that ``"".join(tostringlist(element)) ==
tostring(element)``.
.. versionadded:: 2.7
...
...
@@ -459,7 +461,7 @@ ElementTree Objects
root element.
.. method:: write(file, encoding=
None, xml_declaration=None, method=None
)
.. method:: write(file, encoding=
"us-ascii", xml_declaration=None, method="xml"
)
Writes the element tree to a file, as XML. *file* is a file name, or a
file object opened for writing. *encoding* [1]_ is the output encoding
...
...
Lib/test/test_xml_etree.py
Dosyayı görüntüle @
88db6f40
...
...
@@ -617,7 +617,7 @@ def parsefile():
"""
def
parseliteral
():
r
"""
"""
>>> element = ET.XML("<html><body>text</body></html>")
>>> ET.ElementTree(element).write(sys.stdout)
<html><body>text</body></html>
...
...
@@ -631,7 +631,7 @@ def parseliteral():
>>> print "".join(ET.tostringlist(element))
<html><body>text</body></html>
>>> ET.tostring(element, "ascii")
"<?xml version='1.0' encoding='ascii'?>\n<html><body>text</body></html>"
"<?xml version='1.0' encoding='ascii'?>
\
\
n<html><body>text</body></html>"
>>> _, ids = ET.XMLID("<html><body>text</body></html>")
>>> len(ids)
0
...
...
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