OwlCyberSecurity - MANAGER
Edit File: sax.cpython-312.pyc
� C��gW$ � � � d Z ddlmZ ddlmZ ddlmZmZ ddlmZm Z G d� dej � Zd� Z G d � d e� Z G d� d� Zd � Zy)a? SAX-based adapter to copy trees from/to the Python standard library. Use the `ElementTreeContentHandler` class to build an ElementTree from SAX events. Use the `ElementTreeProducer` class or the `saxify()` function to fire the SAX events of an ElementTree against a SAX ContentHandler. See https://lxml.de/sax.html � )�ContentHandler)�etree)�ElementTree� SubElement)�Comment�ProcessingInstructionc � � e Zd ZdZy)�SaxErrorzGeneral SAX error. N)�__name__� __module__�__qualname__�__doc__� � �9/opt/hc_python/lib64/python3.12/site-packages/lxml/sax.pyr r s � �r r c �V � | d dk( rt | dd j dd� � S d | fS )Nr �{� �})�tuple�split)�tags r � _getNsTagr s3 � � �1�v��}��S���W�]�]�3��*�+�+��S�y�r c � � e Zd ZdZdd�Zd� Z eeej �� Zd� Zd� Z d� Z d � Zd � Zd� Z dd�Zd � Zd� Zdd�Zd� Zd� ZeZy)�ElementTreeContentHandlerz/Build an lxml ElementTree from SAX events. Nc � � t j | � d | _ g | _ g | _ d | _ d d gi| _ i | _ |�t j }|| _ y �N)r �__init__�_root�_root_siblings�_element_stack�_default_ns�_ns_mapping� _new_mappingsr �Element�_makeelement)�self�makeelements r r z"ElementTreeContentHandler.__init__% s] � �����%��� � ��� ������!�T�F�,���������-�-�K�'��r c �, � t | j � S )z=Contains the generated ElementTree after parsing is finished.)r r �r'