Your IP : 3.137.212.29


Current Path : /opt/alt/python313/lib64/python3.13/xml/sax/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib64/python3.13/xml/sax/__pycache__/expatreader.cpython-313.pyc

�

2}g�>����SrSrSSK7 SSKJrJr SSKJr SSKJrJr SSKJ	r	 SSKJ
r
Jr SS	KJ
r
 \"\
S
5(d	\"SS5eSS
KJrJrJr \R*r\R,rSSKrSSKr\R2rCC"SS5r"SS\R85r"SS\R<\R85rSr \!S:XaySSK"r#\ "5r$\$RK\#RLR&RO55 \$RQ\#RLRS55 \$RUS5 gg!\a
 \"SS5ef=f!\a SrN�f=f)z]
SAX driver for the pyexpat C module.  This driver works with
pyexpat.__version__ == '2.22'.
z0.20�)�*)�feature_validation�feature_namespaces)�feature_namespace_prefixes)�feature_external_ges�feature_external_pes)�feature_string_interning)�property_xml_string�property_interning_dict)�expat�ParserCreatezexpat not supportedN)�	xmlreader�saxutils�handlerc��U$�N�)�os �:/opt/alt/python313/lib64/python3.13/xml/sax/expatreader.py�_mkproxyr!s����c��\rSrSrSrg)�
_ClosedParser�(rN)�__name__�
__module__�__qualname__�__firstlineno__�__static_attributes__rrrrr(s��rrc�6�\rSrSrSrSrSrSrSrSr	Sr
g	)
�ExpatLocator�-z�Locator for use with the ExpatParser class.

This uses a weak reference to the parser object to avoid creating
a circular reference between the parser and the content handler.
c�$�[U5Ulgr)r�_ref��self�parsers  r�__init__�ExpatLocator.__init__3s���V�$��	rc�b�URnURcgURR$r)r$�_parser�ErrorColumnNumberr%s  r�getColumnNumber�ExpatLocator.getColumnNumber6s(�������>�>�!���~�~�/�/�/rc�b�URnURcgURR$�N�)r$r+�ErrorLineNumberr%s  r�
getLineNumber�ExpatLocator.getLineNumber<s(�������>�>�!���~�~�-�-�-rc�V�URnUcgURR5$r)r$�_source�getPublicIdr%s  rr7�ExpatLocator.getPublicIdB�&�������>���~�~�)�)�+�+rc�V�URnUcgURR5$r)r$r6�getSystemIdr%s  rr;�ExpatLocator.getSystemIdHr9r)r$N)rrrr�__doc__r(r-r3r7r;rrrrr!r!-s ���
%�0�.�,�,rr!c���\rSrSrSrS%SjrSrSrSrSr	Sr
S	rS
rS&Sjr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"S!r#S"r$S#r%g$)'�ExpatParser�Qz$SAX driver for the pyexpat C module.c���[RRX5 [R"5UlSUlXlSUlSUl/Ul	SUl
SUlg)NFr)r�IncrementalParserr(�InputSourcer6r+�_namespaces�_lex_handler_prop�_parsing�
_entity_stack�
_external_ges�
_interning)r&�namespaceHandling�bufsizes   rr(�ExpatParser.__init__TsY���#�#�,�,�T�;� �,�,�.������,��!%�����
���������rc��[R"U5nXlUR5 URR[
U55 [RRX5 g! UR5 e=f)z3Parse an XML document from a URL or an InputSource.N)r�prepare_input_sourcer6�reset�
_cont_handler�setDocumentLocatorr!rrB�parse�
_close_source�r&�sources  rrR�ExpatParser.parseasj���.�.�v�6����		��J�J�L����1�1�,�t�2D�E��'�'�-�-�d�;��	�
��� ��s�AA2�2Bc�z�UR5b*URRUR55 ggr)r;r+�SetBaserTs  r�
prepareParser�ExpatParser.prepareParserqs1������+��L�L� � ��!3�!3�!5�6�,rc��[RRX5 UR(aUR	5 ggr)rrB�setContentHandlerrF�_reset_cont_handler)r&rs  rr\�ExpatParser.setContentHandlerws.���#�#�5�5�d�D��=�=��$�$�&�rc���U[:XaUR$U[:XaURSL$U[[
[4;agU[:XaUR$[SU-5e)Nr�Feature '%s' not recognized)
rrDr	rIrrrrrH�SAXNotRecognizedException�r&�names  r�
getFeature�ExpatParser.getFeature|sn���%�%��#�#�#�
�-�
-��?�?�$�.�.�
�(�*>�0�2�2��
�)�
)��%�%�%�'�(E��(L�M�Mrc��UR(a[S5eU[:XaX lgU[:XaX lgU[:Xa%U(aURc0UlggSUlgU[:XaU(a[S5egU[:XaU(a[S5egU[:XaU(a[S5eg[SU-5e)Nz!Cannot set features while parsingz!expat does not support validationz/expat does not read external parameter entitiesz(expat does not report namespace prefixesr`)rF�SAXNotSupportedExceptionrrDrrHr	rIrrrra)r&rc�states   r�
setFeature�ExpatParser.setFeature�s����=�=�*�+N�O�O��%�%�$��
�)�
)�!&��
�-�
-���?�?�*�&(�D�O�+�#'���
�'�
'��.�7�9�9���)�
)��.�E�G�G���/�
/��.�>�@�@��,�-��4�6�
6rc�V�U[R:XaUR$U[:XaUR$U[
:Xa\UR(a@[URS5(aURR5$[S5e[S5e[SU-5e)N�GetInputContextz=This version of expat does not support getting the XML stringz.XML string cannot be returned when not parsing�Property '%s' not recognized)r�property_lexical_handlerrErrIr
r+�hasattrrlrargrbs  r�getProperty�ExpatParser.getProperty�s����7�3�3�3��)�)�)�
�,�
,��?�?�"�
�(�
(��|�|��4�<�<�):�;�;��<�<�7�7�9�9�3�*�+�+�/�D�F�F�'�(F��(M�N�Nrc���U[R:Xa)X lUR(aUR	5 ggU[
:XaX lgU[:Xa[SU-5e[SU-5e)NzProperty '%s' cannot be setrm)
rrnrErF�_reset_lex_handler_proprrIr
rgra)r&rc�values   r�setProperty�ExpatParser.setProperty�sw���7�3�3�3�%*�"��}�}��,�,�.��
�,�
,�#�O�
�(�
(�*�+H�+/�,0�1�
1�,�,J�,0�-1�2�
2rc��UR(d1UR5 SUlURR5 URRX5 g![RaOn[[R"UR5X05nURRU5 SnAgSnAff=f)NT)
rFrOrP�
startDocumentr+�Parser�error�SAXParseException�ErrorString�code�_err_handler�
fatalError)r&�data�isFinal�e�excs     r�feed�ExpatParser.feed�s����}�}��J�J�L� �D�M����,�,�.�		.�

�L�L���t�-���{�{�	.�#�E�$5�$5�a�f�f�$=�q�G�C����(�(��-�-��	.�s�A � C�4AB>�>Cc��URcgURR5nURRS5 URRSS5 URRU5 g![R
aOn[
[R"UR5X 5nURRU5 SnANzSnAff=f!URRU5 f=f)NFr)r+�GetReparseDeferralEnabled�SetReparseDeferralEnabledryrrzr{r|r}r~r)r&�was_enabledr�r�s    r�flush�ExpatParser.flush�s����<�<����l�l�<�<�>��	@��L�L�2�2�5�9��L�L���s�E�*�

�L�L�2�2�;�?��	�{�{�	.�#�E�$5�$5�a�f�f�$=�q�G�C����(�(��-�-��	.��
�L�L�2�2�;�?�s*�7A=�=C �AC�C#�C � C#�#Dc��URnUR5nUbUR5 UR5nUbUR5 gg!UR5nUbUR5 ff=fr)r6�getCharacterStream�close�
getByteStream)r&rU�files   rrS�ExpatParser._close_source�su������	��,�,�.�D����
�
���'�'�)�D����
�
�� ���'�'�)�D����
�
�� �s�#A�&A<c��UR(d,URb[UR[5(agUR	SSS9 UR
R
5 SUlSUlSUlURbF[5nURRUlURRUl	XlUR5 g!SUlURbF[5nURRUlURRUl	XlUR5 f=f)NrT)r�F)rGr+�
isinstancerr�rP�endDocumentrFr,r2rSr%s  rr��ExpatParser.close�s������$�,�,�"6��t�|�|�]�3�3��	!��I�I�c�4�I�(����*�*�,�!�D�M��D�L�!�D�M��|�|�'�&���+/�<�<�+I�+I��(�)-���)E�)E��&�%����� ��"�D�M��|�|�'�&���+/�<�<�+I�+I��(�)-���)E�)E��&�%����� �s
�8C#�#A,Ec��URRURlURRURlgr)rP�processingInstructionr+�ProcessingInstructionHandler�
characters�CharacterDataHandler�r&s rr]�ExpatParser._reset_cont_handlers5��$(�$6�$6�$L�$L�	
���1�,0�,>�,>�,I�,I����)rc�,�URnURnUc$SUlSUlSUlSUlSUlgURUlURUlURUlURUlURUlgr)rEr+�CommentHandler�StartCdataSectionHandler�EndCdataSectionHandler�StartDoctypeDeclHandler�EndDoctypeDeclHandler�comment�
startCDATA�endCDATA�start_doctype_decl�endDTD)r&�lexr's   rrs�#ExpatParser._reset_lex_handler_props����$�$�������;�$(�F�!�.2�F�+�,0�F�)�-1�F�*�+/�F�(�$'�K�K�F�!�.1�n�n�F�+�,/�L�L�F�)�-1�-D�-D�F�*�+.�:�:�F�(rc�X�UR(a�[R"URR	5SUR
S9UlSURlURURl	URURlOr[R"URR	5UR
S9UlURURl	URURlUR5 URURlUR"URlUR&URlUR*URlSUlUR0(aUR35 UR4URlUR8URlURR?[R@5 SUl!/Ul"g![<a NDf=f)N� )�internr1F)#rDrr
r6�getEncodingrIr+�namespace_prefixes�start_element_ns�StartElementHandler�end_element_ns�EndElementHandler�
start_element�end_elementr]�unparsed_entity_decl�UnparsedEntityDeclHandler�
notation_decl�NotationDeclHandler�start_namespace_decl�StartNamespaceDeclHandler�end_namespace_decl�EndNamespaceDeclHandler�_decl_handler_proprErs�external_entity_ref�ExternalEntityRefHandler�skipped_entity_handler�SkippedEntityHandler�AttributeError�SetParamEntityParsing�*XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONErFrGr�s rrO�ExpatParser.resets������ �-�-�d�l�l�.F�.F�.H�#�59�_�_�F�D�L�./�D�L�L�+�/3�/D�/D�D�L�L�,�-1�-@�-@�D�L�L�*� �-�-�d�l�l�.F�.F�.H�7;���H�D�L�/3�/A�/A�D�L�L�,�-1�-=�-=�D�L�L�*�� � �"�15�1J�1J����.�+/�+=�+=����(�15�1J�1J����.�/3�/F�/F����,�"&����!�!��(�(�*�15�0H�0H����-�	�04�0K�0K�D�L�L�-�	
���*�*��<�<�	>���
������	��	�s�	H�
H)�(H)c�J�URcgURR$r)r+r,r�s rr-�ExpatParser.getColumnNumberCs���<�<����|�|�-�-�-rc�J�URcgURR$r0)r+r2r�s rr3�ExpatParser.getLineNumberHs���<�<����|�|�+�+�+rc�6�URR5$r)r6r7r�s rr7�ExpatParser.getPublicIdM����|�|�'�'�)�)rc�6�URR5$r)r6r;r�s rr;�ExpatParser.getSystemIdPr�rc�N�URRU[U55 gr)rP�startElement�AttributesImpl)r&rc�attrss   rr��ExpatParser.start_elementTs�����'�'��n�U�.C�Drc�:�URRU5 gr)rP�
endElementrbs  rr��ExpatParser.end_elementW������%�%�d�+rc���UR5n[U5S:XaSU4nO%[U5S:XaUSUS4nO[U5n0n0nUR5HeupgUR5n[U5n	U	S:XaUn
SU4nO0U	S:XaUS<SUS<3n
USUS4nOUSn
[U5nXtU'X�U'Mg URRUS[
XE55 g)Nr1�r��:)�split�len�tuple�itemsrP�startElementNS�AttributesNSImpl)r&rcr��pair�newattrs�qnames�anamert�parts�length�qname�apairs            rr��ExpatParser.start_element_nsZs����z�z�|���t�9��>��$�<�D�
��Y�!�^���7�D��G�#�D���;�D�����#�k�k�m�N�U��K�K�M�E���Z�F���{����u�
���1��#(��8�U�1�X�6���a��%��(�*���a����e���#�U�O�!�5�M�!,�$	
���)�)�$��*:�8�*L�	Nrc���UR5n[U5S:XaSU4nO%[U5S:XaUSUS4nO[U5nURR	US5 g)Nr1r�r)r�r�r�rP�endElementNS)r&rcr�s   rr��ExpatParser.end_element_ns|s]���z�z�|���t�9��>��$�<�D�
��Y�!�^���7�D��G�#�D���;�D����'�'��d�3rc�:�URRX5 gr)rPr�)r&�targetr�s   r�processing_instruction�"ExpatParser.processing_instruction�s�����0�0��>rc�:�URRU5 gr)rPr�)r&r�s  r�character_data�ExpatParser.character_data�r�rc�:�URRX5 gr)rP�startPrefixMapping)r&�prefix�uris   rr�� ExpatParser.start_namespace_decl�s�����-�-�f�:rc�:�URRU5 gr)rP�endPrefixMapping)r&r�s  rr��ExpatParser.end_namespace_decl�s�����+�+�F�3rc�<�URRXU5 gr)rE�startDTD)r&rc�sysid�pubid�has_internal_subsets     rr��ExpatParser.start_doctype_decl�s�����'�'��U�;rc�<�URRXX55 gr)�_dtd_handler�unparsedEntityDecl)r&rc�baser�r�
notation_names      rr�� ExpatParser.unparsed_entity_decl�s�����,�,�T�%�Orc�<�URRXU5 gr)r�notationDecl)r&rcrr�rs     rr��ExpatParser.notation_decl�s�����&�&�t�E�:rc��UR(dgURRXC5n[R"UUR
R
5=(d S5nURRURUR
45 URRU5Ul	XPl[RRX5 URSuUl	UlURS	g! g=f)Nr1�r���)rH�_ent_handler�
resolveEntityrrNr6r;rG�appendr+�ExternalEntityParserCreaterrBrR)r&�contextrr�rrUs      rr��ExpatParser.external_entity_ref�s����!�!���"�"�0�0��>���.�.�v�/3�|�|�/G�/G�/I�02�/1�3��	
���!�!�4�<�<����">�?��|�|�>�>�w�G�����	��'�'�-�-�d�;�(,�'9�'9�"�'=�$���t�|����r�"���	��s�>D�Dc�R�U(aSU-nURRU5 g)N�%)rP�
skippedEntity)r&rc�is_pes   rr��"ExpatParser.skipped_entity_handler�s"����t�8�D����(�(��.r)	r�rGrHrIrErDr+rFr6N)ri�)F)&rrrrr=r(rRrYr\rdrirprur�r�rSr�r]rsrOr-r3r7r;r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr?r?Qs���.�	�� 7�'�

N�6�<O�$2� .�"@�	�!�*J�
6� # �N.�
,�
*�*�E�,� N�D	4�?�,�;�4�<�P�;��,/rr?c��[U0UD6$r)r?)�args�kwargss  r�
create_parserr�s����'��'�'r�__main__z:http://www.ibiblio.org/xml/examples/shakespeare/hamlet.xml)+r=�version�xml.sax._exceptions�xml.sax.handlerrrrrrr	r
r�xml.parsersrro�SAXReaderNotAvailable�ImportError�xml.saxrrrr�r��_weakref�weakref�proxyrr�Locatorr!rBr?rr�xml.sax.saxutils�xml�pr\�sax�XMLGenerator�setErrorHandler�ErrorHandlerrRrrr�<module>r1s\���
��!�B�6�F�4�H�A�!��5�.�)�)�#�$9�4�@�@�*�0�0��)�)���-�-��
��
��}�}�H���	�	�
,�9�$�$�,�Hg/�)�-�-�y�/@�/@�g/�V(�
�z�����A�������(�(�5�5�7�8����c�g�g�*�*�,�-��G�G�H�I���a
�=�
� 5�t�
<�<�=������s�E�0E�E�	E'�&E'

?>