Viewing File: /opt/alt/python38/lib64/python3.8/xml/etree/__pycache__/ElementTree.cpython-38.pyc
U
,a @ s d Z ddddddddd d
ddd
ddddddddddddgZdZddlZddlZddlZddlZddlZddlZddl Z ddl
mZ G dd
d
eZ
d d ZG d!d dZi fd"dZd]d#dZd^d$dZeZG d%d
d
ZG d&d dZe jd'd( Zd_d)d*Zd+d, Zd-ZzeeZW n ek
r. Y nX d.d/ Zd0d1 Zeeed2Zd3d Z d4d5d6d7d8d9d:d;Z!e!e _!d<d= Z"d>d? Z#d@dA Z$dBdC Z%d`dddDdEdFdZ&G dGdH dHej'Z(dadddDdEdIdZ)dJd Z*dbdKd Z+dcdLdZ,G dMd dZ-dddNdZ.dedOdZ/e.Z0dfdPdZ1G dQd dZ2G dRd dZ3dgdddSdTdZ4e5dUej6j7Z8G dVd dZ9dWdX Z:dYdZ Z;zeZ<dd[l=T dd\l=m>Z> W n e?k
r Y nX e>ee dS )ha Lightweight XML support for Python.
XML is an inherently hierarchical data format, and the most natural way to
represent it is with a tree. This module has two classes for this purpose:
1. ElementTree represents the whole XML document as a tree and
2. Element represents a single node in this tree.
Interactions with the whole document (reading and writing to/from files) are
usually done on the ElementTree level. Interactions with a single XML element
and its sub-elements are done on the Element level.
Element is a flexible container object designed to store hierarchical data
structures in memory. It can be described as a cross between a list and a
dictionary. Each Element has a number of properties associated with it:
'tag' - a string containing the element's name.
'attributes' - a Python dictionary storing the element's attributes.
'text' - a string containing the element's text content.
'tail' - an optional string containing text after the element's end tag.
And a number of child elements stored in a Python sequence.
To create an element instance, use the Element constructor,
or the SubElement factory function.
You can also use the ElementTree class to wrap an element structure
and convert it to and from XML.
CommentdumpElementElementTree
fromstringfromstringlist iselement iterparseparse
ParseErrorPIProcessingInstructionQName
SubElementtostringtostringlistTreeBuilderVERSIONXMLXMLID XMLParser
XMLPullParserregister_namespacecanonicalizeC14NWriterTargetz1.3.0 N )ElementPathc @ s e Zd ZdZdS )r
zAn error when parsing an XML document.
In addition to its exception value, a ParseError contains
two extra attributes:
'code' - the specific exception code
'position' - the line and column of the error
N)__name__
__module____qualname____doc__ r! r! :/opt/alt/python38/lib64/python3.8/xml/etree/ElementTree.pyr
j s c C s
t | dS )z2Return True if *element* appears to be an Element.tag)hasattr)elementr! r! r"