← Back
Editing: xmlutils.cpython-311.pyc
� �|�ev � �V � d Z ddlZddlmZ G d� de� � Z G d� de� � ZdS )z' Utilities for XML generation/parsing. � N)�XMLGeneratorc � � e Zd ZdS )�UnserializableContentErrorN)�__name__� __module__�__qualname__� � �7/usr/lib/python3/dist-packages/django/utils/xmlutils.pyr r s � � � � � ��Dr r c �, � � e Zd Zdd�Zd� Z� fd�Z� xZS )�SimplerXMLGeneratorNc � � |�i }| � ||� � |�| � |� � | � |� � dS )z9Convenience method for adding an element with no childrenN)�startElement� characters� endElement)�self�name�contents�attrss r �addQuickElementz#SimplerXMLGenerator.addQuickElement sR � ��=��E����$��&�&�&����O�O�H�%�%�%���������r c �| � |r$t j d|� � rt d� � �t j | |� � d S )Nz[\x00-\x08\x0B-\x0C\x0E-\x1F]z/Control characters are not supported in XML 1.0)�re�searchr r r )r �contents r r zSimplerXMLGenerator.characters sJ � �� `�r�y�!A�7�K�K� `� -�-^�_�_�_����g�.�.�.�.�.r c � �� |r.t t |� � � � � � � n|}t � � � ||� � d S )N)�dict�sorted�items�superr )r r r �sorted_attrs� __class__s �r r z SimplerXMLGenerator.startElement sJ �� �6;�F�t�F�5�;�;�=�=�1�1�2�2�2��� �����T�<�0�0�0�0�0r )NN)r r r r r r � __classcell__)r! s @r r r s[ �� � � � � �� � � �/� /� /�1� 1� 1� 1� 1� 1� 1� 1� 1r r )�__doc__r �xml.sax.saxutilsr � ValueErrorr r r r r �<module>r&