Pelokalan
Python ID
id en
Masuk
Proyek
library__xml-etree-elementtree.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
:func:`fromstring` parses XML from a string directly into an :class:`Element`, which is the root element of the parsed tree. Other parsing functions may create an :class:`ElementTree`. Check the documentation to be sure.
Most parsing functions provided by this module require the whole document to be read at once before returning any result. It is possible to use an :class:`XMLParser` and feed data into it incrementally, but it is a push API that calls methods on a callback target, which is too low-level and inconvenient for most needs. Sometimes what the user really wants is to be able to parse XML incrementally, without blocking operations, while enjoying the convenience of fully constructed :class:`Element` objects.
A better way to search the namespaced XML example is to create a dictionary with your own prefixes and use those in the search functions::
Functions
Fungsi-Fungsi
The *comment_factory* and *pi_factory* functions, when given, should behave like the :func:`Comment` and :func:`ProcessingInstruction` functions to create comments and processing instructions. When not given, the default factories will be used. When *insert_comments* and/or *insert_pis* is true, comments/pis will be inserted into the tree if they appear within the root element (but not outside of it).