Your IP : 3.144.6.236


Current Path : /opt/alt/python311/lib64/python3.11/xml/dom/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/xml/dom/__pycache__/minidom.cpython-311.opt-2.pyc

�

c��f,
����	ddlZddlZddlmZmZmZmZddlTddlm	Z	m
Z
ejjj
ejjjfZGd�dejj��Zeedd�	��eed
d�	��eedd
�	��d�Zd�Zd�Zd�Zd�ZGd�de��ZGd�de��Zeedd�	��eedd�	��eedd�	��Gd�de��Zeedd�	��eZGd �d!e��Zedd��ZGd"�d#e��Zeed$d%�	��eedd&�	��d'�ZGd(�d)��ZGd*�d+ee��Z Gd,�d-ee��Z!ee!dd.�	��Gd/�d0e!��Z"ee"d1d2�	��ee"d3d4�	��d5�Z#d6�Z$Gd7�d8e!��Z%Gd9�d:e"��Z&Gd;�d<e��Z'ee'dd=�	��Gd>�d?��Z(Gd@�dAe(ee��Z)GdB�dCe(e��Z*GdD�dEe(ee��Z+GdF�dGe	��Z,GdH�dIe��Z-dJ�Z.GdK�dLee
��Z/ee/dMdN�	��dO�Z0dP�Z1dQ�Z2dUdR�Z3dVdS�Z4dVdT�Z5dS)W�N)�EMPTY_NAMESPACE�EMPTY_PREFIX�XMLNS_NAMESPACE�domreg)�*)�DOMImplementationLS�
DocumentLSc��eZdZdZdZdZdZdZeZ	d�Z
dd�Z		dd�Zd�Z
d�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z dS)�NodeNc��dS)NT���selfs �6/opt/alt/python311/lib64/python3.11/xml/dom/minidom.py�__bool__z
Node.__bool__+����t�c�2�|�dd||��S�N�)�toprettyxml)r�encoding�
standalones   r�toxmlz
Node.toxml.s������B��*�=�=�=r�	�
c��|�tj��}n)tjtj��|dd���}|jt
jkr|�|d||||��n|�|d||��|�|���S|�	�����S)N�xmlcharrefreplacer)r�errors�newliner)
�io�StringIO�
TextIOWrapper�BytesIO�nodeTyper�
DOCUMENT_NODE�writexml�getvalue�detach)r�indent�newlrr�writers      rrzNode.toprettyxml1s������[�]�]�F�F��%�b�j�l�l�/7�-@�.2�4�4�4�F��=�D�.�.�.��M�M�&�"�f�d�H�j�I�I�I�I��M�M�&�"�f�d�3�3�3����?�?�$�$�$��=�=�?�?�+�+�-�-�-rc�*�t|j��S�N)�bool�
childNodesrs r�
hasChildNodeszNode.hasChildNodesDs���D�O�$�$�$rc��|jSr.�r0rs r�_get_childNodeszNode._get_childNodesG�
����rc�.�|jr
|jdSdS�Nrr3rs r�_get_firstChildzNode._get_firstChildJs#���?�	&��?�1�%�%�	&�	&rc�.�|jr
|jdSdS�N���r3rs r�_get_lastChildzNode._get_lastChildNs#���?�	'��?�2�&�&�	'�	'rc��|j|jkr/t|j��D]}|�||���|S|j|jvr>tj�t|���dt|�������|j
�|j
�|��|�|�|��n�	|j�
|��}n,#t$rtj����wxYw|jt vrt#|��|j�||��||_||_|r|j|dz
}||_||_nd|_||_
|S)N� cannot be child of �)r%�DOCUMENT_FRAGMENT_NODE�tupler0�insertBefore�_child_node_types�xml�dom�HierarchyRequestErr�repr�
parentNode�removeChild�appendChild�index�
ValueError�NotFoundErr�_nodeTypes_with_children�_clear_id_cache�insert�nextSibling�previousSibling)r�newChild�refChild�crK�nodes      rrBzNode.insertBeforeRs������ ;�;�;��8�.�/�/�
/�
/���!�!�!�X�.�.�.�.��O���D�$:�:�:��'�-�-�.2�8�n�n�n�n�d�4�j�j�j�I�K�K�
K���*���+�+�H�5�5�5������X�&�&�&�&�
,���-�-�h�7�7�����
,�
,�
,��g�)�)�+�+�+�
,����� �$<�<�<���%�%�%��O�"�"�5�(�3�3�3�#+�H� �'/�H�$��
0���u�Q�w�/��#+�� �+/��(�(�+/��(�"&�H���s�C!�!)D
c���|j|jkr.t|j��D]}|�|���|S|j|jvr>tj�t|���dt|�������|jtvrt|��|j�|j�
|��t||��d|_|S�Nr>)r%r@rAr0rJrCrDrErFrGrNrOrHrI�
_append_childrQ)rrVrUs   rrJzNode.appendChildrs����=�D�7�7�7��4�?�+�+�
$�
$��� � ��#�#�#�#��K��=�� 6�6�6��'�-�-�.2�4�j�j�j�j�$�t�*�*�*�E�G�G�
G�
�]�6�
6�
6��D�!�!�!��?�&��O�'�'��-�-�-��d�D�!�!�!�����rc��|j|jkr2|j}|�|��|�||��S|j|jvr>tj�t|���dt|�������||urdS|j
�|j
�|��	|j�|��}n,#t$rtj����wxYw||j|<||_
d|_
|jtvs|jtvrt!|��|j|_|j|_d|_d|_|jr||j_|jr||j_|SrX)r%r@rQrIrBrCrDrErFrGrHr0rKrLrMrNrOrR)rrS�oldChildrTrKs     r�replaceChildzNode.replaceChild�s������ ;�;�;��+�H����X�&�&�&��$�$�X�x�8�8�8���D�$:�:�:��'�-�-�.2�8�n�n�n�n�d�4�j�j�j�I�K�K�
K��x����F���*���+�+�H�5�5�5�	(��O�)�)�(�3�3�E�E���	(�	(�	(��'�%�%�'�'�'�	(����!)�����"���"�����!9�9�9�� �$<�<�<��D�!�!�!�'�3���#+�#;�� �#���#'�� ��#�	<�3;�H�$�0���	<�3;�H� �0��s�7C�)C;c�Z�	|j�|��n,#t$rtj����wxYw|j�|j|j_|j�|j|j_dx|_|_|jtvrt|��d|_|Sr.)r0�removerLrDrErMrQrRr%rNrOrH�rr[s  rrIzNode.removeChild�s���	(��O�"�"�8�,�,�,�,���	(�	(�	(��'�%�%�'�'�'�	(������+�3;�3K�H� �0��#�/�3;�3G�H�$�0�:>�>���x�7��� 8�8�8��D�!�!�!�"�����	��)Ac�l�g}|jD�]}|jtjkr�|jsA|r|j|d_|jr|j|j_|����`|rf|dj|jkrP|d}|j|jz|_|j|_|jr||j_|�����|�|����|�|��|jtj	kr|�
����||jdd�<dSr:)r0r%r�	TEXT_NODE�datarQrR�unlink�append�ELEMENT_NODE�	normalize)r�L�childrVs    rrgzNode.normalize�s,�����_�	&�	&�E��~���/�/��z�$��>�,1�,=��"��)��(�R�<A�<Q��)�9��L�L�N�N�N�N��	$�1�R�5�>�U�^�;�;��R�5�D� $�	�E�J� 6�D�I�',�'8�D�$��(�A�<@��)�9��L�L�N�N�N�N��H�H�U�O�O�O�O���������>�T�%6�6�6��O�O�%�%�%����������rc�2�t|||jp|��Sr.)�_clone_node�
ownerDocument)r�deeps  r�	cloneNodezNode.cloneNode�s���4��t�'9�'A�T�B�B�Brc�B�|jj�||��Sr.)rl�implementation�
hasFeature�r�feature�versions   r�isSupportedzNode.isSupported�s���!�0�;�;�G�W�M�M�Mrc��dSr.r
rs r�_get_localNamezNode._get_localName�s���trc�
�||uSr.r
�r�others  r�
isSameNodezNode.isSameNode�s���u�}�rc�6�|�|d��r|SdSr.)ru�rrss  r�getInterfacezNode.getInterface�s$�����G�T�*�*�	��K��4rc�Z�	|j|dS#ttf$rYdSwxYwr7)�
_user_data�AttributeError�KeyError�r�keys  r�getUserDatazNode.getUserData�s@��	��?�3�'��*�*����)�	�	�	��4�4�	���s��*�*c��d}	|j}n#t$ri}||_YnwxYw||vr||d}|�d}|�||=n||f||<|Sr7)r�r�)rr�rc�handler�old�ds      r�setUserDatazNode.setUserData�s�����	 ���A�A���	 �	 �	 ��A��D�O�O�O�	 �����!�8�8��C�&��)�C��<��G����c�F���G�_�A�c�F��
s��"�"c��t|d��rJt|j�����D]%\}\}}|�|�|||||���$dSdS)Nr�)�hasattr�listr��items�handle)r�	operation�src�dstr�rcr�s       r�_call_user_data_handlerzNode._call_user_data_handler�s~���4��&�&�	C�(,�T�_�-B�-B�-D�-D�(E�(E�
C�
C�$��_�d�G��&��N�N�9�c�4��c�B�B�B��	C�	C�
C�
Crc��dx|_|_|jr1|jD]}|����t	��|_d|_d|_dSr.)rHrlr0rd�NodeListrRrQ)rris  rrdzNode.unlinks\��/3�3���$�,��?�	)���
�
���������&�j�j�D�O�#�������rc��|Sr.r
rs r�	__enter__zNode.__enter__s���rc�.�|���dSr.)rd)r�et�ev�tbs    r�__exit__z
Node.__exit__s�����
�
�
�
�
r�NN)rrNN)!�__name__�
__module__�__qualname__�namespaceURIrHrlrQrRr�prefixrrrr1r4r8r<rBrJr\rIrgrnrurwr{r~r�r�r�rdr�r�r
rrrr"s��������L��J��M��K��O�
�F����>�>�>�>�<@�#�.�.�.�.�&%�%�%����&�&�&�'�'�'����@���"���@��� ���6C�C�C�N�N�N����������������$C�C�C� � � ��������rr�
firstChildzFirst child node, or None.)�doc�	lastChildzLast child node, or None.�	localNamez"Namespace-local name of this node.c�|�|j}|r|d}||_||_|�|��||_dSr:)r0rRrQrerH)rrVr0�lasts    rrYrYsI����J�� ��"�~��#���������d�����D�O�O�Orc�J�|� |jtjkrdS|j}|� dS�NTF)r%rr&rH�rVs r�_in_documentr�'s3��
�
��=�D�.�.�.��4�����
��5rc���	|ri|�dd���dd���dd���dd��}|�|��dSdS)	N�&z&amp;�<z&lt;�"z&quot;�>z&gt;)�replace�write)r,rcs  r�_write_datar�/sr��!����|�|�C��)�)�1�1�#�v�>�>��G�D�(�+�+�G�G�C��,@�,@�	
����T�������rc��|jD]N}|jtjkr&|dks|j|kr|�|��t
|||���O|S�Nr)r0r%rrf�tagNamere�_get_elements_by_tagName_helper)�parent�name�rcrVs    rr�r�6sb���!�8�8���=�D�-�-�-�
�S�[�[�D�L�D�0�0��I�I�d�O�O�O�'��d�B�7�7�7�7�
�Irc���|jD]`}|jtjkrI|dks|j|kr&|dks|j|kr|�|��t||||���a|Sr�)r0r%rrfr�r�re�"_get_elements_by_tagName_ns_helper)r��nsURIr�r�rVs     rr�r�>s|���!�K�K���=�D�-�-�-��c�!�!�T�^�y�%@�%@��#����!2�e�!;�!;��	�	�$����.�t�U�I�r�J�J�J��
�Irc��eZdZejZdZdZdZdZ	ej
ejejej
ejejejfZd�ZdS)�DocumentFragmentz#document-fragmentNc�,�t��|_dSr.)r�r0rs r�__init__zDocumentFragment.__init__Us��"�*�*����r)r�r�r�rr@r%�nodeName�	nodeValue�
attributesrHrfrb�CDATA_SECTION_NODE�ENTITY_REFERENCE_NODE�PROCESSING_INSTRUCTION_NODE�COMMENT_NODE�
NOTATION_NODErCr�r
rrr�r�Gsp�������*�H�#�H��I��J��J��*����0��3��9��*��+�
-��%�%�%�%�%rr�c���eZdZdZejZdZdZdZ	ej
ejfZe
ddfd�Zd�Zd�Zd�Zd�Zeee��xZZd	�Zd
�Zeee��xZZd�Zd�Zeee��Zd
�Zd�Zd�ZdS)�Attr)�_name�_valuer��_prefixr0�
_localNamerl�ownerElementNFc���d|_||_||_||_|�||_t��|_|j�t����dSr.)	r�r�r�r�r�r�r0re�Text)r�qNamer�r�r�s     rr�z
Attr.__init__csZ�� �����
�(������� �'�D�O�"�*�*���	
����t�v�v�&�&�&�&�&rc�t�	|jS#t$r$|j�dd��dcYSwxYw�N�:r?r;)r�r�r��splitrs rrwzAttr._get_localNamersM��	3��?�"���	3�	3�	3��=�&�&�s�A�.�.�r�2�2�2�2�	3�����	�+7�7c��|jSr.)�	specifiedrs r�_get_specifiedzAttr._get_specifiedx�
���~�rc��|jSr.)r�rs r�	_get_namezAttr._get_name{�
���z�rc�N�||_|j�t|j��dSdSr.)r�r�rO�r�values  r�	_set_namezAttr._set_name~s1����
���(��D�-�.�.�.�.�.�)�(rc��|jSr.)r�rs r�
_get_valuezAttr._get_value��
���{�rc��||_||jd_|j�t	|j��||jd_dSr7)r�r0rcr�rOr�s  r�
_set_valuezAttr._set_value�sG�����"'��������(��D�-�.�.�.�"'�������rc��|jSr.)r�rs r�_get_prefixzAttr._get_prefix��
���|�rc��|j}|dkr,|r*|tkrtj�d���||_|�|j}n|�d|j��}|jrt|j��||_	dS)N�xmlnsz5illegal use of 'xmlns' prefix for the wrong namespacer�)
r�rrDrE�NamespaceErrr�r�r�rOr�)rr��nsuri�newNames    r�_set_prefixzAttr._set_prefix�s����!���W����
M��/�1�1��g�*�*�K�M�M�M�����>��n�G�G�!'������8�G���	/��D�-�.�.�.���	�	�	rc��|j}|�T|j|j=|j|j|jf=|jr,d|_|xjdzc_|jxj	dzc_	|j
D]}|����|j
dd�=dS)NFr?)r��_attrsr��_attrsNSr�r��_is_id�_magic_id_nodesrl�_magic_id_countr0rd)r�elemris   rrdzAttr.unlink�s���
� ������D�M�*��
�t�0�$�.�A�B��{�
8�#����$�$��)�$�$��"�2�2�a�7�2�2��_�	�	�E��L�L�N�N�N�N��O�A�A�A���rc���|jrdS|j}|j}|�|�dS|�|��}|�dS|jr |�|j|j��S|�|j��Sr�)	r�rlr��_get_elem_infor��isIdNSr��isIdr��rr�r��infos    r�	_get_isIdzAttr._get_isId�s����;�	��4�� ��� ���;�$�,��5��!�!�$�'�'���<��5���	,��;�;�t�0�$�.�A�A�A��9�9�T�]�+�+�+rc���|j}|j}|�|�tS|�|��}|�tS|jr |�|j|j��S|�|j��Sr.)	rlr��_no_typer�r��getAttributeTypeNSr��getAttributeTyper�r�s    r�_get_schemaTypezAttr._get_schemaType�sy��� ��� ���;�$�,��O��!�!�$�'�'���<��O���	8��*�*�4�+<�d�n�M�M�M��(�(���7�7�7r) r�r�r��	__slots__r�ATTRIBUTE_NODEr%r�r�r�rbr�rCrr�rwr�r�r��propertyr�r�r�r�r�r�r�r�r�rdrrr
rrr�r�YsG������W�I��"�H��J��I�
�F����)C�D��+:�d��'�'�'�'�3�3�3�������/�/�/�
�h�y�)�4�4�4�H�t����(�(�(�!���Z�8�8�8�I�����
�
�
��X�k�;�
/�
/�F����",�,�,� 8�8�8�8�8rr�r�z True if this attribute is an ID.z'Namespace-local name of this attribute.�
schemaTypezSchema type for this attribute.c��eZdZ	dZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zdd�Z
eZd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�NamedNodeMap�r�r��
_ownerElementc�0�||_||_||_dSr.r)r�attrs�attrsNSr�s    rr�zNamedNodeMap.__init__�s�������
�)����rc�*�t|j��Sr.)�lenr�rs r�_get_lengthzNamedNodeMap._get_length�s���4�;���rc��	|t|j�����|S#t$rYdSwxYwr.)r�r��keys�
IndexError�rrKs  r�itemzNamedNodeMap.item�sO��	���T�[�-�-�/�/�0�0��7�8�8���	�	�	��4�4�	���s�14�
A�Ac��g}|j���D]#}|�|j|jf���$|Sr.)r��valuesrer�r��rrhrVs   rr�zNamedNodeMap.items�sG�����K�&�&�(�(�	2�	2�D�
�H�H�d�m�T�Z�0�1�1�1�1��rc��g}|j���D]*}|�|j|jf|jf���+|Sr.)r�rrer�r�r�rs   r�itemsNSzNamedNodeMap.itemsNS�sQ�����K�&�&�(�(�	H�	H�D�
�H�H�t�(�$�.�9�4�:�F�G�G�G�G��rc�P�t|t��r	||jvS||jvSr.)�
isinstance�strr�r�r�s  r�__contains__zNamedNodeMap.__contains__�s.���c�3���	(��$�+�%�%��$�-�'�'rc�4�|j���Sr.)r�rrs rrzNamedNodeMap.keyss���{���!�!�!rc�4�|j���Sr.)r�rrs r�keysNSzNamedNodeMap.keysNSs���}�!�!�#�#�#rc�4�|j���Sr.)r�rrs rrzNamedNodeMap.values
s���{�!�!�#�#�#rNc�8�|j�||��Sr.�r��get)rr�r�s   rr(zNamedNodeMap.get
s���{���t�U�+�+�+rc��|jt|dd��urdSt|��t|��kt|��t|��kz
S)Nr�r)r��getattr�idrys  r�_cmpzNamedNodeMap._cmpsM���;�'�%��4�8�8�8�8��1��t�H�H�r�%�y�y�(�R��X�X��5�	�	�-A�B�Brc�4�|�|��dkSr7�r,rys  r�__eq__zNamedNodeMap.__eq__����y�y����1�$�$rc�4�|�|��dkSr7r.rys  r�__ge__zNamedNodeMap.__ge__r0rc�4�|�|��dkSr7r.rys  r�__gt__zNamedNodeMap.__gt__����y�y����!�#�#rc�4�|�|��dkSr7r.rys  r�__le__zNamedNodeMap.__le__!r0rc�4�|�|��dkSr7r.rys  r�__lt__zNamedNodeMap.__lt__$r5rc�`�t|t��r
|j|S|j|Sr.)rrAr�r�)r�attname_or_tuples  r�__getitem__zNamedNodeMap.__getitem__'s1���&��.�.�	1��=�!1�2�2��;�/�0�0rc�`�t|t��r]	|j|}nE#t$r8t	|��}|jj|_|�|��YnwxYw||_dSt|t��std���|}|�|��dS)Nz%value must be a string or Attr object)
rr r�r�r�r
rl�setNamedItemr��	TypeError)r�attnamer�rVs    r�__setitem__zNamedNodeMap.__setitem__.s����e�S�!�!�	$�
(��{�7�+�����
(�
(�
(��G�}�}��%)�%7�%E��"��!�!�$�'�'�'�'�'�
(�����D�J�J�J��e�T�*�*�
I�� G�H�H�H��D����d�#�#�#�#�#s�
%�?A'�&A'c�@�	|j|S#t$rYdSwxYwr.)r�r��rr�s  r�getNamedItemzNamedNodeMap.getNamedItem=s6��	��;�t�$�$���	�	�	��4�4�	���s��
�c�D�	|j||fS#t$rYdSwxYwr.)r�r��rr�r�s   r�getNamedItemNSzNamedNodeMap.getNamedItemNSCs;��	��=�,�	�!:�;�;���	�	�	��4�4�	���s��
�c��|�|��}|�Nt|j��|j|j=|j|j|jf=t|d��rd|_	|Stj�����Nr�)
rDrOr
r�r�r�r�r�r�r�rDrErM�rr��ns   r�removeNamedItemzNamedNodeMap.removeNamedItemIs|�����d�#�#���=��D�.�/�/�/���A�J�'��
�q�~�q�{�;�<��q�.�)�)�
&�!%����H��'�%�%�'�'�'rc�
�|�||��}|�Nt|j��|j|j|jf=|j|j=t|d��rd|_	|Stj����rI)
rGrOr
r�r�r�r�r�r�r�rDrErM�rr�r�rKs    r�removeNamedItemNSzNamedNodeMap.removeNamedItemNSUs~������i�8�8���=��D�.�/�/�/��
�q�~�q�{�;�<���A�J�'��q�.�)�)�
&�!%����H��'�%�%�'�'�'rc��t|t��s>tj�t|���dt|�������|j�|j��}|r|�	��||j|j<||j
|j|jf<|j
|_t|j��|SrX)rr�rDrErFrGr�r(r�rdr�r�r�r
r�rO)rrVr�s   rr>zNamedNodeMap.setNamedItemas����$��%�%�	G��'�-�-�.2�4�j�j�j�j�$�t�*�*�*�E�G�G�
G��k�o�o�d�i�(�(���	��J�J�L�L�L�!%���D�I��=A��
�t�(�$�.�9�:� �.�����)�*�*�*��
rc�,�|�|��Sr.)r>�rrVs  r�setNamedItemNSzNamedNodeMap.setNamedItemNSns��� � ��&�&�&rc�f�||}t|j��|���dSr.)rOr�rd)rr;rVs   r�__delitem__zNamedNodeMap.__delitem__qs/���$�%����)�*�*�*����
�
�
�
�
rc�*�|j|j|jfSr.rrs r�__getstate__zNamedNodeMap.__getstate__vs���{�D�M�4�+=�=�=rc�0�|\|_|_|_dSr.r�r�states  r�__setstate__zNamedNodeMap.__setstate__ys��9>�6���T�]�D�$6�$6�$6rr.) r�r�r�rr�rrr�rr!rr$rr(�__len__r,r/r2r4r7r9r<rArDrGrLrOr>rSrUrWr[r
rrrr�s��������8�I�*�*�*�
 � � ����������(�(�(�"�"�"�$�$�$�$�$�$�,�,�,�,��G�C�C�C�%�%�%�%�%�%�$�$�$�%�%�%�$�$�$�1�1�1�
$�
$�
$�������
(�
(�
(�
(�
(�
(����'�'�'����
>�>�>�?�?�?�?�?rr�lengthz$Number of nodes in the NamedNodeMap.c�*�eZdZdZd�Zd�Zd�Zd�ZdS)�TypeInfo��	namespacer�c�"�||_||_dSr.r`)rrar�s   rr�zTypeInfo.__init__�s��"�����	�	�	rc��|jr d|jj�d|j�d|j�d�Sd|jj�d|j�d�S)Nr�� z (from z)>r�)ra�	__class__r�r�rs r�__repr__zTypeInfo.__repr__�s`���>�	D�	D�*.�.�*A�*A�*A�4�9�9�9�*.�.�.�.�:�
:�	D�!%�� 7� 7� 7�����C�Crc��|jSr.)r�rs rr�zTypeInfo._get_name��
���y�rc��|jSr.)rars r�_get_namespacezTypeInfo._get_namespace�r�rN)r�r�r�rr�rfr�rjr
rrr_r_�sX������#�I����D�D�D��������rr_c�&�eZdZdZejZdZeZ	dZ
ejejejej
ejejfZeddfd�Zd�Zd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�ZeZd�Zd�Z d�Z!e!Z"d�Z#d�Z$d�Z%d�Z&d�Z'dd�Z(d�Z)d�Z*d�Z+d�Z,d�Z-dS) �Element)rlrHr�r�r�r�r�r0r�r�rQrRNrc��d|_|x|_|_||_||_t��|_dx|_|_d|_	d|_
dSr.)rHr�r�r�r�r�r0rQrRr�r�)rr�r�r�r�s     rr�zElement.__init__�sU�����'.�.���t�}����(���"�*�*���26�6���4�/������
�
�
rc�4�|j�i|_i|_dSdSr.)r�r�rs r�_ensure_attributeszElement._ensure_attributes�s$���;���D�K��D�M�M�M��rc�t�	|jS#t$r$|j�dd��dcYSwxYwr�)r�r�r�r�rs rrwzElement._get_localName�sM��	2��?�"���	2�	2�	2��<�%�%�c�1�-�-�b�1�1�1�1�	2���r�c��|jSr.�r�rs r�_get_tagNamezElement._get_tagName�r�rc���|j�=t|j�����D]}|����d|_d|_t
�|��dSr.)r�r�rrdr�r)r�attrs  rrdzElement.unlink�sd���;�"��T�[�/�/�1�1�2�2�
�
�����
�
�
�
������
����D�����rc�^�	|j�dS	|j|jS#t$rYdSwxYwr)r�r�r�)rr@s  r�getAttributezElement.getAttribute�sM��	��;���2�	��;�w�'�-�-���	�	�	��2�2�	���s��
,�,c�`�|j�dS	|j||fjS#t$rYdSwxYwr)r�r�r�rFs   r�getAttributeNSzElement.getAttributeNS�sK���=� ��2�	��=�,�	�!:�;�A�A���	�	�	��2�2�	���s��
-�-c��|�|��}|�9t|��}||_|j|_|�|��dS||jkr||_|jrt
|��dSdSdSr.)�getAttributeNoder�r�rl�setAttributeNoder�rO)rr@r�rus    r�setAttributezElement.setAttribute�s����$�$�W�-�-���<���=�=�D��D�J�!%�!3�D���!�!�$�'�'�'�'�'�
�d�j�
 �
 ��D�J��y�
&���%�%�%�%�%�!�
 �
&�
&rc�X�t|��\}}|�||��}|�<t||||��}||_|j|_|�|��dS||jkr||_|jrt|��|j|kr||_||_	dSdSr.)
�_nssplit�getAttributeNodeNSr�r�rlr|r�rOr�r�)rr��
qualifiedNamer�r��	localnamerus       r�setAttributeNSzElement.setAttributeNS�s���$�]�3�3���	��&�&�|�Y�?�?���<��
�|�Y��G�G�D��D�J�!%�!3�D���!�!�$�'�'�'�'�'���
�"�"�"��
��9�*�#�D�)�)�)��{�f�$�$�$��� -��
�
�
�%�$rc�H�|j�dS|j�|��Sr.r')r�attrnames  rr{zElement.getAttributeNodes#���;���4��{���x�(�(�(rc�L�|j�dS|j�||f��Sr.)r�r(rFs   rr�zElement.getAttributeNodeNS
s*���=� ��4��}� � �,�	�!:�;�;�;rc��|jd|fvrtj�d���|���|j�|jd��}|�|�|��|j	�|j
|jfd��}|�||ur|�|��t||��||ur|S||ur|SdS)Nzattribute node already owned)
r�rDrE�InuseAttributeErrror�r(r��removeAttributeNoder�r�r��_set_attribute_node)rru�old1�old2s    rr|zElement.setAttributeNodes�����T�4�L�0�0��'�+�+�,J�K�K�K����!�!�!��{���t�y�$�/�/�����$�$�T�*�*�*��}� � �$�"3�T�^�!D�d�K�K�����D� 0� 0��$�$�T�*�*�*��D�$�'�'�'��t����K��t����K��rc���|j�tj����	|j|}n,#t
$rtj����wxYw|�|��dSr.)r�rDrErMr�r�r�)rr�rus   r�removeAttributezElement.removeAttribute'sz���=� ��'�%�%�'�'�'�	(��;�t�$�D�D���	(�	(�	(��'�%�%�'�'�'�	(����� � ��&�&�&�&�&s	�
5�)Ac���|j�tj����	|j||f}n,#t$rtj����wxYw|�|��dSr.)r�rDrErMr�r�)rr�r�rus    r�removeAttributeNSzElement.removeAttributeNS0s���=� ��'�%�%�'�'�'�	(��=�,�	�!:�;�D�D���	(�	(�	(��'�%�%�'�'�'�	(����� � ��&�&�&�&�&s	�7�)A c�$�|�tj����	|j|jn,#t
$rtj����wxYwt
|��|���|j|_|Sr.)	rDrErMr�r�r�rOrdrlrRs  rr�zElement.removeAttributeNode9s����<��'�%�%�'�'�'�	(��K��	�"�"�"���	(�	(�	(��'�%�%�'�'�'�	(������������
�
�
�"�/����s	�5�)Ac�(�	|j�dS||jvS�NF�r�rCs  r�hasAttributezElement.hasAttributeIs#��	�
�;���5��t�{�"�"rc�*�|j�dS||f|jvSr�)r�rFs   r�hasAttributeNSzElement.hasAttributeNSSs!���=� ��5��i�(�D�M�9�9rc�>�	t||t����Sr.�r�r�rCs  r�getElementsByTagNamezElement.getElementsByTagNameXs��	�
/�t�T�8�:�:�F�F�Frc�>�t|||t����Sr.�r�r�rFs   r�getElementsByTagNameNSzElement.getElementsByTagNameNS`�!��1��,�	�8�:�:�7�7�	7rc�4�d|jt|��fzS)Nz<DOM Element: %s at %#x>)r�r+rs rrfzElement.__repr__ds��)�T�\�2�d�8�8�,D�D�Drrc�D�	|�|dz|jz��|���}|���D]J}|�d|z��t	|||j��|�d���K|jr�|�d��t|j��dkrN|jdjtj
tjfvr$|jd�|ddd��nO|�|��|jD]}|�|||z||���|�|��|�d|j�d|����dS|�d	|z��dS)
Nr�z %s="r�r�r?rrz</z/>%s)
r�r��_get_attributesrr�r�r0rr%rrbr�r')rr,r*�	addindentr+r�a_namerVs        rr'zElement.writexmlgs���	�	���V�C�Z�$�,�.�/�/�/��$�$�&�&���j�j�l�l�	�	�F��L�L��F�*�+�+�+����f�
� 3�4�4�4��L�L�������?�
	(��L�L������D�O�$�$��)�)����"�+����(?�0A�A�A����"�+�+�F�B��B�?�?�?�?����T�"�"�"� �O�M�M�D��M�M�&�&��*:�I�t�L�L�L�L����V�$�$�$��L�L�L�d�l�l�l�D�D�9�:�:�:�:�:��L�L����'�'�'�'�'rc�`�|���t|j|j|��Sr.)rorr�r�rs rr�zElement._get_attributes�s*�����!�!�!��D�K����=�=�=rc��|jrdSdSr�r�rs r�
hasAttributeszElement.hasAttributes�s���;�	��4��5rc�Z�|�|��}|�|��dSr.)r{�setIdAttributeNode)rr��idAttrs   r�setIdAttributezElement.setIdAttribute�s/���&�&�t�,�,������'�'�'�'�'rc�\�|�||��}|�|��dSr.)r�r�)rr�r�r�s    r�setIdAttributeNSzElement.setIdAttributeNS�s1���(�(��y�A�A������'�'�'�'�'rc�\�|�|�|j��stj����t|���tj����|js=d|_|xjdz
c_|j	xj
dz
c_
t|��dSdS)NTr?)r{r�rDrErM�_get_containing_entref�NoModificationAllowedErrr�r�rlr�rO)rr�s  rr�zElement.setIdAttributeNode�s����>�����1D�!E�!E�>��'�%�%�'�'�'�!�$�'�'�3��'�2�2�4�4�4��}�	"� �F�M�� � �A�%� � ���.�.�!�3�.�.��D�!�!�!�!�!�		"�	"r�rrr).r�r�r�rrrfr%r�rr	r�r�r�rbr�r�rCrr�rorwrsrdrwryr}r�r{r�r|�setAttributeNodeNSr�r�r��removeAttributeNodeNSr�r�r�r�rfr'r�r�r�r�r�r
rrrlrl�s������1�I�� �H��I��J��O��*��9��*����0��3�5��.=�T������(���
2�2�2���������� ���
&�
&�
&�.�.�.�")�)�)�
<�<�<�
���&*��'�'�'�'�'�'����0��#�#�#�:�:�:�
G�G�G�7�7�7�E�E�E�(�(�(�(�@>�>�>����(�(�(�(�(�(�	"�	"�	"�	"�	"rrlr�z*NamedNodeMap of attributes on the element.z%Namespace-local name of this element.c��t|��|���||j|j<||j|j|jf<||_dSr.)rOror�r�r�r�r�r�)�elementrus  rr�r��sW���G������� � � � $�G�N�4�9��<@�G��d�'���8�9�
 �D���rc�d�eZdZ	dZdZe��ZdZdZd�Z	d�Z
d�Zd�Zd�Z
d�Zd	�Zd
�ZdS)�	Childlessr
Nc��dSr.r
rs rr8zChildless._get_firstChild�rrc��dSr.r
rs rr<zChildless._get_lastChild�rrc�P�tj�|jdz���)Nz nodes cannot have children�rDrErFr�rRs  rrJzChildless.appendChild��'���g�)�)��M�9�9�;�;�	;rc��dSr�r
rs rr1zChildless.hasChildNodes�����urc�P�tj�|jdz����Nz nodes do not have childrenr��rrSrTs   rrBzChildless.insertBefore�r�rc�P�tj�|jdz���r�)rDrErMr�r_s  rrIzChildless.removeChild�s'���g�!�!��M�9�9�;�;�	;rc��dSr.r
rs rrgzChildless.normalize�s���rc�P�tj�|jdz���r�r��rrSr[s   rr\zChildless.replaceChild�r�r)r�r�r�rr��
EmptyNodeListr0r�r�r8r<rJr1rBrIrgr\r
rrr�r��s���������I��J�����J��J��I�������;�;�;����;�;�;�;�;�;�
�
�
�;�;�;�;�;rr�c�v�eZdZejZdZd�Zd�Zd�Z	e
ee	��Zd�Zd�Z
e
ee
��Zd
d�Zd	S)�ProcessingInstruction��targetrcc�"�||_||_dSr.r�)rr�rcs   rr�zProcessingInstruction.__init__�s�������	�	�	rc��|jSr.�rcrs r�_get_nodeValuez$ProcessingInstruction._get_nodeValue�rhrc��||_dSr.r�r�s  r�_set_nodeValuez$ProcessingInstruction._set_nodeValue�s
����	�	�	rc��|jSr.�r�rs r�
_get_nodeNamez#ProcessingInstruction._get_nodeName�r�rc��||_dSr.r�r�s  r�
_set_nodeNamez#ProcessingInstruction._set_nodeName�s
������rrc	�Z�|�|�d|j�d|j�d|����dS)Nz<?rd�?>)r�r�rc�rr,r*r�r+s     rr'zProcessingInstruction.writexml�s5��������t�{�{�{�D�I�I�I�t�t�L�M�M�M�M�MrNr�)r�r�r�rr�r%rr�r�r�rr�r�r�r�r'r
rrr�r��s��������/�H�"�I����
����������8�8�I��������x�
�}�5�5�H�N�N�N�N�N�Nrr�c�n�eZdZdZd�Zd�ZeZd�Zd�Ze	ee��xZ
Zd�Zd�Z
d�Zd	�Zd
�Zd�ZdS)
�
CharacterData)�_datarlrHrRrQc��dx|_|_dx|_|_d|_t
�|��dSr)rlrHrRrQr�rr�rs rr�zCharacterData.__init__�s@��/3�3���T�_�26�6���t�/���
��
�
�d�����rc�*�t|j��Sr.)rrcrs rrzCharacterData._get_length����4�9�~�~�rc��|jSr.�r�rs r�	_get_datazCharacterData._get_datar�rc��||_dSr.r��rrcs  r�	_set_datazCharacterData._set_data	s
����
�
�
rc�z�|j}t|��dkrd}nd}d|jj�d|dd��|�d�S)N�
z...rz<DOM z node "rz">)rcrrer�)rrc�	dotdotdots   rrfzCharacterData.__repr__sO���y���t�9�9�r�>�>��I�I��I���N�#�#�#�T�!�B�$�Z�Z����<�	<rc�(�|dkrtj�d���|t|j��krtj�d���|dkrtj�d���|j|||z�S�Nr�offset cannot be negative�#offset cannot be beyond end of datazcount cannot be negative�rDrE�IndexSizeErrrrc�r�offset�counts   r�
substringDatazCharacterData.substringDatas����A�:�:��'�&�&�'B�C�C�C��S���^�^�#�#��'�&�&�'L�M�M�M��1�9�9��'�&�&�'A�B�B�B��y���u��,�-�-rc�$�|j|z|_dSr.r�)r�args  r�
appendDatazCharacterData.appendData s���I��O��	�	�	rc��|dkrtj�d���|t|j��krtj�d���|r)|jd|��|�|j|d���|_dSdS)Nrr�r�r�)rr�r�s   r�
insertDatazCharacterData.insertData#s����A�:�:��'�&�&�'B�C�C�C��S���^�^�#�#��'�&�&�'L�M�M�M��	=��	�'�6�'�"�"�C�C���6�7�7�);�);�=�D�I�I�I�	=�	=rc�^�|dkrtj�d���|t|j��krtj�d���|dkrtj�d���|r)|jd|�|j||zd�z|_dSdSr�r�r�s   r�
deleteDatazCharacterData.deleteData,s����A�:�:��'�&�&�'B�C�C�C��S���^�^�#�#��'�&�&�'L�M�M�M��1�9�9��'�&�&�'A�B�B�B��	F��	�'�6�'�*�T�Y�v�e�|�}�}�-E�E�D�I�I�I�	F�	Frc�d�|dkrtj�d���|t|j��krtj�d���|dkrtj�d���|r,|jd|��|�|j||zd���|_dSdSr�r�)rr�r�r�s    r�replaceDatazCharacterData.replaceData6s����A�:�:��'�&�&�'B�C�C�C��S���^�^�#�#��'�&�&�'L�M�M�M��1�9�9��'�&�&�'A�B�B�B��	C��	�'�6�'�"�"�C�C���6�%�<�=�=�)A�)A�C�D�I�I�I�	C�	CrN)r�r�r�rr�rr\r�r�rrcr�rfr�r�r�r�r�r
rrr�r��s�������W�I��������G������� �x�	�9�5�5�5�D�9�<�<�<�.�.�.�$�$�$�=�=�=�F�F�F�	C�	C�	C�	C�	Crr�zLength of the string data.c�H�eZdZdZejZdZdZd�Z	d
d�Z
d�Zd�Zd	�Z
dS)r�r
z#textNc��|dks|t|j��krtj�d���|���}|j|d�|_|j|_|j}|jrF||jj	vr8|�|j�
|��n|j�||��|jd|�|_|S)Nrzillegal offset value)rrcrDrEr�rerlrQrHr0rJrB)rr��newText�nexts    r�	splitTextzText.splitTextKs����A�:�:��#�d�i�.�.�0�0��'�&�&�'=�>�>�>��.�.�"�"���y����)��� $� 2�������?�	<�t�t��'A�A�A��|���+�+�G�4�4�4�4���,�,�W�d�;�;�;��I�g�v�g�&��	��rrc�<�t||�|j�|����dSr.)r�rcr�s     rr'z
Text.writexmlZs'���F����	�	�4�4�@�A�A�A�A�Arc�r�|jg}|j}|�E|jtjtjfvr#|�d|j��|j}nn|�E|j}|�D|jtjtjfvr"|�|j��|j}nn|�Dd�	|��S)Nrr)
rcrRr%rrbr�rPrQre�join)rrhrKs   r�_get_wholeTextzText._get_wholeText_s���
�Y�K��� ���m��z�d�n�d�.E�F�F�F�����A�F�#�#�#��%�����m�
����m��z�d�n�d�.E�F�F�F������ � � ��M�����m��w�w�q�z�z�rc��|j}|j}|�A|jtjtjfvr|j}|�|��|}nn|�A|j}|s|�|��|�A|jtjtjfvr|j}|�|��|}nn|�A|r	||_|SdSr.)	rHrRr%rrbr�rIrQrc)r�contentr�rKr�s     r�replaceWholeTextzText.replaceWholeTextqs������� ���m��z�d�n�d�.E�F�F�F��(���"�"�1�%�%�%�����
�m�
����	%����t�$�$�$��m��z�d�n�d�.E�F�F�F��}���"�"�1�%�%�%�����
�m��	��D�I��K��4rc���|j���rdSt|��}|�dS|j�|��}|�dS|���Sr�)rc�strip�_get_containing_elementrlr��isElementContent)rr�r�s   r�!_get_isWhitespaceInElementContentz&Text._get_isWhitespaceInElementContent�sd���9�?�?���	��5�&�t�,�,���<��5��!�0�0��6�6���<��5��(�(�*�*�*rr�)r�r�r�rrrbr%r�r�r�r'rrr
r
rrr�r�Ds~�������I��~�H��H��J�
�
�
�B�B�B�B�
���$���8
+�
+�
+�
+�
+rr��isWhitespaceInElementContentzKTrue iff this text node contains only whitespace and is in element content.�	wholeTextz.The text of all logically-adjacent text nodes.c�X�|j}|� |jtjkr|S|j}|� dSr.)rHr%rrf�rVrUs  rrr�s8����A�
�-��:��*�*�*��H�
�L���-��4rc�X�|j}|� |jtjkr|S|j}|� dSr.)rHr%rr�rs  rr�r��s8����A�
�-��:��3�3�3��H�
�L���-��4rc�.�eZdZejZdZd�Zdd�ZdS)�Commentz#commentc�H�t�|��||_dSr.)r�r�r�r�s  rr�zComment.__init__�s!�����t�$�$�$���
�
�
rrc�z�d|jvrtd���|�|�d|j�d|����dS)Nz--z%'--' is not allowed in a comment nodez<!--z-->)rcrLr�r�s     rr'zComment.writexml�sI���4�9����D�E�E�E��������	�	�	�4�4�@�A�A�A�A�ArNr�)	r�r�r�rr�r%r�r�r'r
rrrr�sJ������� �H��H����B�B�B�B�B�Brrc�,�eZdZdZejZdZdd�ZdS)�CDATASectionr
z#cdata-sectionrc��|j�d��dkrtd���|�d|jz��dS)Nz]]>rz$']]>' not allowed in a CDATA sectionz<![CDATA[%s]]>)rc�findrLr�r�s     rr'zCDATASection.writexml�sJ���9�>�>�%� � �A�%�%��C�D�D�D����%��	�1�2�2�2�2�2rNr�)	r�r�r�rrr�r%r�r'r
rrrr�s:�������I��&�H��H�3�3�3�3�3�3rrc�b�eZdZdZdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�ZdS)�ReadOnlySequentialNamedNodeMap��_seqr
c��||_dSr.r)r�seqs  rr�z'ReadOnlySequentialNamedNodeMap.__init__�s
����	�	�	rc�*�t|j��Sr.�rrrs rr\z&ReadOnlySequentialNamedNodeMap.__len__�r�rc�*�t|j��Sr.rrs rrz*ReadOnlySequentialNamedNodeMap._get_length�r�rc�8�|jD]}|j|kr|cS�dSr.)rr�rJs   rrDz+ReadOnlySequentialNamedNodeMap.getNamedItem�s8����	�	�A��z�T�!�!�����"�	�	rc�N�|jD]}|j|kr|j|kr|cS�dSr.)rr�r�rNs    rrGz-ReadOnlySequentialNamedNodeMap.getNamedItemNS�s@����	�	�A��~��-�-�!�+��2J�2J������	�	rc��t|t��r|j|�}n|�|��}|�t	|���|Sr.)rrArGrDr�)r�
name_or_tuplerVs   rr<z*ReadOnlySequentialNamedNodeMap.__getitem__�sP���m�U�+�+�	4�&�4�&�
�6�D�D��$�$�]�3�3�D��<��=�)�)�)��rc�P�|dkrdS	|j|S#t$rYdSwxYwr7)rrrs  rrz#ReadOnlySequentialNamedNodeMap.item�sD���1�9�9��4�	��9�U�#�#���	�	�	��4�4�	���s��
%�%c�@�tj�d����Nz"NamedNodeMap instance is read-only�rDrEr�rCs  rrLz.ReadOnlySequentialNamedNodeMap.removeNamedItem�����g�.�.�0�2�2�	2rc�@�tj�d���r'r(rFs   rrOz0ReadOnlySequentialNamedNodeMap.removeNamedItemNS�r)rc�@�tj�d���r'r(rRs  rr>z+ReadOnlySequentialNamedNodeMap.setNamedItem�r)rc�@�tj�d���r'r(rRs  rrSz-ReadOnlySequentialNamedNodeMap.setNamedItemNS�r)rc��|jgSr.rrs rrWz+ReadOnlySequentialNamedNodeMap.__getstate__s���	�{�rc� �|d|_dSr7rrYs  rr[z+ReadOnlySequentialNamedNodeMap.__setstate__s���!�H��	�	�	rN)r
)r�r�r�rr�r\rrDrGr<rrLrOr>rSrWr[r
rrrr�s��������I��������������
���
������2�2�2�2�2�2�2�2�2�2�2�2��������rrz&Number of entries in the NamedNodeMap.c�&�eZdZ	dZd�Zd�Zd�ZdS)�
Identified��publicId�systemIdc�"�||_||_dSr.r1)rr2r3s   r�_identified_mixin_initz!Identified._identified_mixin_inits�� ��
� ��
�
�
rc��|jSr.)r2rs r�
_get_publicIdzIdentified._get_publicId�
���}�rc��|jSr.)r3rs r�
_get_systemIdzIdentified._get_systemIdr8rN)r�r�r�rr5r7r:r
rrr0r0
sI������J�&�I�!�!�!��������rr0c�J�eZdZejZdZdZdZdZ	dZ
d�Zd�Zd�Z
dd�ZdS)�DocumentTypeNc��t��|_t��|_|rt|��\}}||_|j|_dSr.)r�entities�	notationsrr�r�)rr�r�r�s    rr�zDocumentType.__init__$sJ��6�8�8��
�7�9�9����	"� (�� 7� 7��F�I�!�D�I��	��
�
�
rc��|jSr.)�internalSubsetrs r�_get_internalSubsetz DocumentType._get_internalSubset,����"�"rc���|j��etd��}|j|_|j|_tjjj}|�rg|j_	g|j
_	|j
j	D]X}t|j|j|j
��}|j
j	�|��|�|||���Y|jj	D]�}t!|j|j|j
|j��}|j|_|j|_|j|_|jj	�|��|�|||����|�|||��|SdSr.)rlr<r�r�rDrE�UserDataHandler�NODE_CLONEDr>rr?�Notationr2r3rer��Entity�notationName�actualEncodingrrt)rrm�cloner�rK�notation�e�entitys        rrnzDocumentType.cloneNode/s^����%� ��&�&�E���E�J�!�Y�E�N���/�;�I��
D�&(���#�')���$���,�F�F�A�'��
�A�J��
�K�K�H��O�(�/�/��9�9�9��-�-�i��H�E�E�E�E���+�D�D�A�#�A�J��
�A�J�$%�N�4�4�F�,-�,<�F�)�&'�j�F�O�%&�Y�F�N��N�'�.�.�v�6�6�6��-�-�i��F�C�C�C�C��(�(��D�%�@�@�@��L��4rrc
���|�d��|�|j��|jr,|�|�d|j�d|�d|j�d���n'|jr |�|�d|j�d���|j�D|�d��|�|j��|�d��|�d|z��dS)	Nz
<!DOCTYPE z
  PUBLIC '�'z  'z
  SYSTEM 'z [�]r�)r�r�r2r3rAr�s     rr'zDocumentType.writexmlJs������\�"�"�"����T�Y�����=�	D��L�L� �D�D�$�-�-�-����t�}�}�}�F�
G�
G�
G�
G�
�]�	D��L�L�d�d�d�D�M�M�M�B�C�C�C���*��L�L������L�L��,�-�-�-��L�L��������S��X�����rr�)r�r�r�r�DOCUMENT_TYPE_NODEr%r�r�r2r3rAr�rBrnr'r
rrr<r<sv�������&�H��I��D��H��H��N�"�"�"�#�#�#����6�����rr<c�`�eZdZdZejZdZdZdZ	dZ
d�Zd�Zd�Z
d�Zd�Zd�Zd�Zd	�ZdS)
rHNc�t�||_||_t��|_|�||��dSr.)r�rIr�r0r5)rr�r2r3rLs     rr�zEntity.__init__as8����
�$���"�*�*����#�#�H�h�7�7�7�7�7rc��|jSr.�rJrs r�_get_actualEncodingzEntity._get_actualEncodinggrCrc��|jSr.�rrs r�
_get_encodingzEntity._get_encodingjr8rc��|jSr.�rtrs r�_get_versionzEntity._get_versionmr�rc�@�tj�d���)Nz(cannot append children to an entity node�rDrErF)rrSs  rrJzEntity.appendChildps���g�)�)�6�8�8�	8rc�@�tj�d���)Nz+cannot insert children below an entity noder_r�s   rrBzEntity.insertBeforets���g�)�)�9�;�;�	;rc�@�tj�d���)Nz*cannot remove children from an entity noder_r_s  rrIzEntity.removeChildxs���g�)�)�8�:�:�	:rc�@�tj�d���)Nz)cannot replace children of an entity noder_r�s   rr\zEntity.replaceChild|s���g�)�)�7�9�9�	9r)r�r�r�r�r�ENTITY_NODEr%r�rJrrtr�rWrZr]rJrBrIr\r
rrrHrHXs��������J���H��I��N��H��G�8�8�8�#�#�#�������8�8�8�;�;�;�:�:�:�9�9�9�9�9rrHc�&�eZdZejZdZd�ZdS)rGNc�@�||_|�||��dSr.)r�r5)rr�r2r3s    rr�zNotation.__init__�s%����
��#�#�H�h�7�7�7�7�7r)r�r�r�rr�r%r�r�r
rrrGrG�s0�������!�H��I�8�8�8�8�8rrGc�4�eZdZgd�Zd�Zd�Zd�Zd�Zd�ZdS)�DOMImplementation))�core�1.0)rh�2.0)rhN)rDri)rDrj)rDN)�ls-loadz3.0)rkNc�L�|dkrd}|���|f|jvSr)�lower�	_featuresrrs   rrqzDOMImplementation.hasFeature�s*���b�=�=��G��
�
����)�T�^�;�;rc�b�|r&|j�tj�d���|���}|duo|duo|du}|s!|rtj�d���|r�t
|��\}}|dkr%|dkrtj�d���|r!|stj�d���|�||��}|r|�	|��|�	|��|r|x|_|_
||_||_|S)Nz(doctype object owned by another DOM treezElement with no namerDz$http://www.w3.org/XML/1998/namespacezillegal use of 'xml' prefixz(illegal use of prefix without namespaces)
rHrDrE�WrongDocumentErr�_create_document�InvalidCharacterErrrr��createElementNSrJrl�doctyperp)	rr�r�rtr��add_root_elementr�r�r�s	         r�createDocumentz DOMImplementation.createDocument�sz���	<�w�)�5��'�*�*�:�<�<�
<��#�#�%�%�� ,�� 4�!4�$1�T�$9�!4�$+�t�O�5���
	F�!1�
	F��'�-�-�.D�E�E�E��	%� (�� 7� 7��F�I������#I�I�I��g�*�*�+H�I�I�I��
@�l�
@��g�*�*�>�@�@�@��)�)�,�
�F�F�G��
)�����(�(�(��O�O�G�$�$�$��	=�9<�<�G���!6����!����
rc�@�t|��}||_||_|Sr.)r<r2r3)rr�r2r3rts     r�createDocumentTypez$DOMImplementation.createDocumentType�s$���}�-�-��#���#����rc�6�|�|d��r|SdSr.)rqr}s  rr~zDOMImplementation.getInterface�s"���?�?�7�D�)�)�	��K��4rc��t��Sr.)�Documentrs rrqz"DOMImplementation._create_document�s���z�z�rN)	r�r�r�rnrqrvrxr~rqr
rrrgrg�sq���������I�<�<�<�
+�+�+�Z����������rrgc�J�eZdZ	dZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZdS)�ElementInforrc��||_dSr.rrrCs  rr�zElementInfo.__init__�s
������rc��tSr.�r�r�anames  rrzElementInfo.getAttributeType�����rc��tSr.r�rFs   rrzElementInfo.getAttributeTypeNS�r�rc��dSr�r
rs rr	zElementInfo.isElementContent�r�rc��	dSr�r
rs r�isEmptyzElementInfo.isEmpty�s��	��urc��	dSr�r
r�s  rr�zElementInfo.isId�s
��E��urc��	dSr�r
rFs   rr�zElementInfo.isIdNS�s
��J��urc��|jSr.rrrs rrWzElementInfo.__getstate__�r�rc��||_dSr.rrrYs  rr[zElementInfo.__setstate__�s
������rN)
r�r�r�rr�rrr	r�r�r�rWr[r
rrr}r}�s���������I����������������
�������������rr}c���|jtjkr"|j���d|_dSt
|��r,|jj���d|j_dSdSr.)r%rr&�	_id_cache�clear�_id_search_stackr�rlr�s rrOrOsw���}��*�*�*�������� $�����	�d�	�	�2���$�*�*�,�,�,�-1���+�+�+�2�2rc�l�eZdZdZejejejejfZ	e
��ZejZ
dZdZdZdZdxZZdZdZdZdZdZdZdZdZd�Zd�Zd�Zd	�Zd
�Z d�Z!d�Z"d
�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d�Z+d�Z,d�Z-d�Z.d�Z/d�Z0d�Z1d�Z2d�Z3d�Z4d�Z5d �Z6d!�Z7d"�Z8d#�Z9d$�Z:		d(d&�Z;d'�Z<dS))r{)�
_elem_infortr�r0r�z	#documentNFrc�d�d|_t��|_i|_i|_d|_dSr.)rtr�r0r�r�r�rs rr�zDocument.__init__%s2�����"�*�*��������� $����rc�p�|jr|j|jf}n|j}|j�|��Sr.)r�r�r�r�r()rr�r�s   rr�zDocument._get_elem_info.s<����	"��&��(9�9�C�C��/�C���"�"�3�'�'�'rc��|jSr.rVrs rrWzDocument._get_actualEncoding5rCrc��|jSr.)rtrs r�_get_doctypezDocument._get_doctype8r�rc��|jSr.)�documentURIrs r�_get_documentURIzDocument._get_documentURI;s����rc��|jSr.rYrs rrZzDocument._get_encoding>r8rc��|jSr.)�errorHandlerrs r�_get_errorHandlerzDocument._get_errorHandlerAs��� � rc��|jSr.)rrs r�_get_standalonezDocument._get_standaloneDr5rc��|jSr.)�strictErrorCheckingrs r�_get_strictErrorCheckingz!Document._get_strictErrorCheckingGs���'�'rc��|jSr.r\rs rr]zDocument._get_versionJr�rc��|j|jvr>tj�t|���dt|�������|j�|j�|��|jtj	kr3|�
��rtj�d���t�||��S)Nr>z two document elements disallowed)r%rCrDrErFrGrHrIrrf�_get_documentElementrJrRs  rrJzDocument.appendChildMs����=�� 6�6�6��'�-�-�.2�4�j�j�j�j�$�t�*�*�*�E�G�G�
G��?�&�
�O�'�'��-�-�-��=�D�-�-�-��(�(�*�*�.��'�-�-�2�4�4�
4�����d�+�+�+rc���	|j�|��n,#t$rtj����wxYwdx|_|_d|_|j	|urd|_	|Sr.)
r0r^rLrDrErMrQrRrH�documentElementr_s  rrIzDocument.removeChild]s���	(��O�"�"�8�,�,�,�,���	(�	(�	(��'�%�%�'�'�'�	(����:>�>���x�7�"�����8�+�+�#'�D� ��r`c�L�|jD]}|jtjkr|cS�dSr.)r0r%rrfrRs  rr�zDocument._get_documentElementis;���O�	�	�D��}�� 1�1�1�����2�	�	rc��|j� |j���d|_t�|��dSr.)rtrdrrs rrdzDocument.unlinkns=���<�#��L���!�!�!��D�L����D�����rc��|sdS|j�ddd��}|j|_|j|_|j|_|jD]f}t
|||��}|j�|��|jtj
krn|jtjkr||_||_
�g|�tjjj||��|Sr.)rprvrrrtr0rkrer%rr&rRrtrHr�rDrErErF)rrmrKrK�
childclones     rrnzDocument.cloneNodets����	��4��#�2�2�4��t�D�D�������?������
���		*�		*�A�$�Q��e�4�4�J���#�#�J�/�/�/��"�d�&8�8�8�8��$��(?�?�?� *��
�$)�J�!�!��$�$�S�W�%<�%H�%)�5�	2�	2�	2��rc�0�t��}||_|Sr.)r�rl)rr�s  r�createDocumentFragmentzDocument.createDocumentFragment�s����������rc�2�t|��}||_|Sr.)rlrl)rr�rMs   r�
createElementzDocument.createElement�s���G��������rc��t|t��std���t��}||_||_|S�Nznode contents must be a string)rr r?r�rcrl)rrc�ts   r�createTextNodezDocument.createTextNode�s?���$��$�$�	>��<�=�=�=��F�F���������rc��t|t��std���t��}||_||_|Sr�)rr r?rrcrl�rrcrUs   r�createCDATASectionzDocument.createCDATASection�s?���$��$�$�	>��<�=�=�=��N�N���������rc�2�t|��}||_|Sr.)rrlr�s   r�
createCommentzDocument.createComment�s���D�M�M������rc�4�t||��}||_|Sr.)r�rl)rr�rc�ps    r�createProcessingInstructionz$Document.createProcessingInstruction�s��!�&�$�/�/������rc�@�t|��}||_d|_|Sr)r�rlr�)rr��as   r�createAttributezDocument.createAttribute�s ����K�K���������rc�Z�t|��\}}t|||��}||_|Sr.)rrlrl)rr�r�r�r�rMs      rrszDocument.createElementNS�s1��$�]�3�3���	��M�<��8�8������rc�j�t|��\}}t||||��}||_d|_|Sr)rr�rlr�)rr�r�r�r�r�s      r�createAttributeNSzDocument.createAttributeNS�s:��$�]�3�3���	����i��@�@���������rc�8�t||||��}||_|Sr.)rHrl)rr�r2r3rIrMs      r�_create_entityzDocument._create_entity�s!���4��8�\�:�:������rc�6�t|||��}||_|Sr.)rGrl)rr�r2r3rKs     r�_create_notationzDocument._create_notation�s���T�8�X�.�.������rc��||jvr
|j|S|js	|jsdS|j}|�|jg}||_n|sdSd}|�rx|���}|�d�|jD����|�|��}|r�|j	�
��D]�}|jrG|�|j|j
��r&||j|j<|j|kr|}�F|jsnt�P|�|j��r'||j|j<|j|kr|}��|jsn3��|jr*||j|j<|j|kr|}��|jdkrn��nF|jr?|j	�
��D]%}|jr||j|j<|j|kr|}�&|�n|��x|S)Nc�.�g|]}|jtv�|��Sr
)r%rN)�.0ris  r�
<listcomp>z+Document.getElementById.<locals>.<listcomp>�s2��I�I�I�E�"�^�/G�G�G� �G�G�Grr?)r�r�r�r�r��pop�extendr0r�r�rr�r�r�r�r�r�r�r�)rr+�stack�resultrVr�rus       r�getElementByIdzDocument.getElementById�sN��
������>�"�%�%���	�4�#7�	��4��%���=��)�*�E�$)�D�!�!��	��4����&	��9�9�;�;�D��L�L�I�I�T�_�I�I�I�
J�
J�
J��&�&�t�,�,�D��
*�!�O�2�2�4�4�"�"�D��(�"��;�;�t�'8�$�.�I�I�&�9=�D�N�4�:�6�#�z�R�/�/�)-���%)�%9�&� %������4�9�-�-�"�59���t�z�2��:��+�+�%)�F�F�!%�!5�"�!�E�"���"�59���t�z�2��:��+�+�%)�F�F�!�1�Q�6�6�!�E����%�
*� �O�2�2�4�4�*�*�D��{�*�59���t�z�2��:��+�+�%)�F���!��M�&	�N�
rc�<�t||t����Sr.r�rCs  rr�zDocument.getElementsByTagNames��.�t�T�8�:�:�F�F�Frc�>�t|||t����Sr.r�rFs   rr�zDocument.getElementsByTagNameNS
r�rc�8�|j�||��Sr.)rprqrrs   rruzDocument.isSupporteds���"�-�-�g�w�?�?�?rc���|jtjkrtj�d���|jtjkrtj�d���t|||��S)Nzcannot import document nodesz!cannot import document type nodes)r%rr&rDrE�NotSupportedErrrRrk)rrVrms   r�
importNodezDocument.importNodesb���=�D�.�.�.��'�)�)�*H�I�I�I�
�]�d�5�
5�
5��'�)�)�*M�N�N�N��4��t�,�,�,rrc��g}|r|�d|�d���|�|�d|rdnd�d���|�dd�|���d|����|jD]}|�||||���dS)	Nz
encoding="r�zstandalone="�yes�noz<?xml version="1.0" rdr�)rer�rr0r')	rr,r*r�r+rr�declarationsrVs	         rr'zDocument.writexmls������	:���� 8�X� 8� 8� 8�9�9�9��!���� O�
�/L�u�u�� O� O� O�P�P�P����L�C�H�H�\�,B�,B�L�L�d�L�L�M�M�M��O�	;�	;�D��M�M�&�&�)�T�:�:�:�:�	;�	;rc��|j|ur*tj�d|�d|j�����|jt
jt
jfvrtj�d���|tkr�d|vrT|�
dd��\}}|dkr4|tjjkrtj�d���nX|dkrI|tjjkr4|jt
jkrtj�d���d}|}nd}d}|jt
jkr&|j
}|�|j}|�|��nd}||_||_||_||_|jt
jkr||_n5||_|�,|�|��|r|�|��|S)	Nz3cannot rename nodes from other documents;
expected z,
found z8renameNode() only applies to element and attribute nodesr�r?r�zillegal use of 'xmlns' prefixz$illegal use of the 'xmlns' attribute)rlrDrErpr%rrfrr�rr�rr�r�r�r�r�r�r�r�r�r�r|r�)rrKr�r�r�r�r��is_ids        r�
renameNodezDocument.renameNode(s����?�$�&�&��'�*�*�*�,0�D�D�!�/�/�C�D�D�
D�
�:�d�/��1D�E�E�E��'�)�)�J�L�L�
L��?�*�*��d�{�{�$(�J�J�s�A�$6�$6�!��	���'�'�&�#�'�*A�A�A��'�.�.�7�9�9�9���g�o�o�&�#�'�*A�A�A��*��(;�;�;��'�.�.�>�@�@�@��� �	�	��F��I��:��,�,�,��n�G��"�����+�+�A�.�.�.���G���� ���%�����
��:��*�*�*��A�I�I��A�F��"��(�(��+�+�+��2��.�.�q�1�1�1��r)rrrNN)=r�r�r�rrrfr�r�rRrCrgrpr&r%r�r�r�rHrRrQrJrrrtr�r�r�r�r�r�rWr�r�rZr�r�r�r]rJrIr�rdrnr�r�r�r�r�r�r�rsr�r�r�r�r�r�rur�r'r�r
rrr{r{
s�������@�I��*�D�,L��*�D�,C�E��'�&�(�(�N��!�H��H��I��J��J�$(�(�O�k�
�N��H��J��G����L��K��O�%�%�%�(�(�(�#�#�#���� � � ����!�!�!����(�(�(����,�,�,� 
�
�
����
������*���
���
���������
���
������������
���
8�8�8�tG�G�G�7�7�7�@�@�@�-�-�-�KO� �;�;�;�;� 3�3�3�3�3rr{r�z#Top-level element of this document.c�
	�	|j�|��rtjjj}ntjjj}|jtj	kr�|�
|j|j��}|j
���D]T}|�|j|j|j��|�|j|j��}|j|_�U|r0|jD](}t+|||��}|�|���)�n<|jtjkrH|���}|r0|jD](}t+|||��}|�|���)�n�|jtjkr|�|j��}�n�|jtjkr|�|j��}�n}|jtjkr"|�|j |j��}�nF|jtj!kr|�"|j��}�n|jtj#kr5|�$|j|j��}d|_|j|_�n�|jtj%k�r�tjjj}|j&�'|j(|j)|j*��}||_|�r:g|j+_,g|j-_,|j-j,D]o}	t]|	j|	j)|	j*��}
||
_|j-j,�/|
��ta|	d��r|	�1||	|
���p|j+j,D]�}te|j|j)|j*|j3��}|j4|_4|j5|_5|j6|_6||_|j+j,�/|��ta|d��r|�1|||����n/tj�7dtq|��z���ta|d��r|�1|||��|S)NTr�zCannot clone node %s)9rlr{rDrErErF�
NODE_IMPORTEDr%rrfrsr�r�r�rr�r�r�r�r�r0rkrJr@r�rbr�rcr�r�r�r�r�r�r�rr�rRrprxr�r2r3r>rr?rGrer�r�rHrIrJrrtr�rG)
rVrm�newOwnerDocumentr�rKrur�rirUrKrLrMrNs
             rrkrkas;�����$�$�%5�6�6�:��G�+�7�	�	��G�+�9�	��}��)�)�)� �0�0��1B�15��@�@���O�*�*�,�,�	)�	)�D�� � ��!2�D�M�4�:�N�N�N��(�(��):�D�N�K�K�A��.�A�K�K��	%���
%�
%����t�-=�>�>���!�!�!�$�$�$�$��	
��$�5�	5�	5� �7�7�9�9���	%���
%�
%����t�-=�>�>���!�!�!�$�$�$�$��	
��$�.�	(�	(� �/�/��	�:�:���	
��$�1�	1�	1� �3�3�D�I�>�>���	
��$�:�	:�	:� �<�<�T�[�=A�Y�H�H���	
��$�+�	+�	+� �.�.�t�y�9�9���	
��$�-�	-�	-� �2�2�4�3D�37�=�B�B������j����	
��$�1�	1�	1��G�+�9�	� �/�B�B��I�t�}�d�m�5�5��.����	D�"$�E�N��#%�E�O� ��^�(�
F�
F��#�A�J��
�A�J�G�G��)9��&���$�+�+�H�5�5�5��1�7�8�8�F��-�-�i��H�E�E�E���]�'�	
D�	
D����
�A�J��
� !��0�0��()�(8��%�"#�*���!"����'7��$���#�*�*�6�2�2�2��1�7�8�8�D��-�-�i��F�C�C�C���
�g�%�%�&<�t�D�z�z�&I�J�J�J�
�t�.�/�/�=��$�$�Y��e�<�<�<��Lrc�l�|�dd��}t|��dkr|Sd|dfS)Nr�r?�r)r�r)r��fieldss  rrr�s<��
�
 �
 ��a�
(�
(�F�
�6�{�{�a����
��f�Q�i� � rc��||i|��}|���\}}|�|��|���|Sr.)�getEvent�
expandNoder�)�func�args�kwargs�events�toktype�rootNodes      r�_do_pulldom_parser��sP��
�T�4�
"�6�
"�
"�F����)�)��G�X�
���h����
�L�L�N�N�N��Orc��	|�|sddlm}|�|��Sddlm}t	|j|f||d���S)Nr��expatbuilder��pulldom)�parser�bufsize)�xml.domr��parser�r�)�filer�r�r�r�s     rr�r��sk��=�
�~�g�~�(�(�(�(�(�(��!�!�$�'�'�'�#�#�#�#�#�#� ������'�2�2�4�4�	4rc�|�	|�ddlm}|�|��Sddlm}t	|j|fd|i��S)Nrr�r�r�)r�r��parseStringr�r�)�stringr�r�r�s    rr�r��se��0�
�~�(�(�(�(�(�(��'�'��/�/�/�#�#�#�#�#�#� ��!4�v�i�"*�F�!3�5�5�	5rc���|rTt|t��rtj|��}|D](\}}tj�||��sdS�)tjSr.)rr r�_parse_feature_stringr{rprq)�features�f�vs   r�getDOMImplementationr��so�����h��$�$�	>��3�H�=�=�H��	�	�D�A�q��*�5�5�a��;�;�
��t�t�
��"�"rr�r.)6r!r�rDrrrr�xml.dom.minicompat�xml.dom.xmlbuilderrr	rErrfr�rN�defpropertyrYr�r�r�r�r�r��objectr�
AttributeListr_rrlr�r�r�r�r�rr�rrrr0r<rHrGrgr}rOr{rkrr�r�r�r�r
rr�<module>rs����"
�	�	�	�����J�J�J�J�J�J�J�J�J�J�J�J� � � � �>�>�>�>�>�>�>�>� �G�L�5��G�L�>�@��t�t�t�t�t�3�7�<�t�t�t�l��D�,�$@�A�A�A�A���D�+�$?�@�@�@�@���D�+�$H�I�I�I�I����������������%�%�%�%�%�t�%�%�%�$y8�y8�y8�y8�y8�4�y8�y8�y8�v��D�&�$F�G�G�G�G���D�+�$M�N�N�N�N���D�,�$E�F�F�F�F�a?�a?�a?�a?�a?�6�a?�a?�a?�F��L�(�6�8�8�8�8��
������v����(�8�D�$����L"�L"�L"�L"�L"�d�L"�L"�L"�\��G�\�<�>�>�>�>���G�[�7�9�9�9�9�	 �	 �	 �&;�&;�&;�&;�&;�&;�&;�&;�RN�N�N�N�N�I�t�N�N�N�4EC�EC�EC�EC�EC�I�t�EC�EC�EC�N��M�8�)E�F�F�F�F�S+�S+�S+�S+�S+�=�S+�S+�S+�j��D�0�.�/�/�/�/���D�+�@�B�B�B�B�������B�B�B�B�B�m�B�B�B�	3�	3�	3�	3�	3�4�	3�	3�	3�<�<�<�<�<�V�<�<�<�|��*�H�8�:�:�:�:�
�
�
�
�
�
�
�
�:�:�:�:�:�:�y�$�:�:�:�x&9�&9�&9�&9�&9�Z��&9�&9�&9�P8�8�8�8�8�z�9�d�8�8�8�M�M�M�M�M�+�M�M�M�^(�(�(�(�(�&�(�(�(�T2�2�2�Q�Q�Q�Q�Q�t�Z�Q�Q�Q�f
��H�'�5�7�7�7�7�O�O�O�d!�!�!����4�4�4�4�5�5�5�5�#�#�#�#�#�#r

?>