python (3.11.7)
    eT1                     j   d dl Z d dlZd dlZd dlmZ d dlmZ d dlm	Z	 d dl
mZ  edd          Zd	Z
 G d
 dej                  Z G d d
ej                  Z G d de          Z G d de          Z G d de	j                  Z G d dej                  Zedk    r ej                     dS dS )    N)AttributesImpl)feature_external_ges)pulldom)findfileztest.xmlxmltestdata)subdira
  <?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xdc="http://www.xml.com/books">
<!-- A comment -->
<title>Introduction to XSL</title>
<hr/>
<p><xdc:author xdc:attrib="prefixed attribute" attrib="other attrib">A. Namespace</xdc:author></p>
</html>c                   f    e Zd Zd Zd Zd Zej        d             Zej        d             Z	d Z
dS )PullDOMTestCasec                 4   	 t          j        t                    }|                     |j        j                   t
          |           t          t          d          5 }t
          t          j        |                     d d d            d S # 1 swxY w Y   d S )Nrb)r   parsetstfile
addCleanupstreamcloselistopen)selfhandlerfins      E/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_pulldom.py
test_parsezPullDOMTestCase.test_parse   s    4 -((,---W
 '4
 
  	%Cs##$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%s   "B
BBc                 
   	 t          j        t                    }t          |          \  }}|                     t          |d                     |                     t           j        |           t          |          \  }}|                     t           j        |           |                     d|j	                   |                     dt          |j                             |                     |j                            d          j
        d           t          |          \  }}|                     t           j        |           t          |          \  }}|                     t           j        |           t          |          \  }}|                     d|j	                   |}t          |          \  }}|                     t           j        |           |                     d|j                   t          |          \  }}|                     t           j        |           |                     d|j	                   |                     ||u            t          |          \  }}|                     t           j        |           t          |          \  }}|                     t           j        |           |                     d|j	                   t          |          \  }}|                     t           j        |           |                     d|j	                   t          |          \  }}|                     t           j        |           t          |          \  }}|                     t           j        |           |                     d	|j	                   t          |          \  }}|                     t           j        |           |                     d
|j	                   t          |          \  }}|                     t           j        |           t          |          \  }}|                     t           j        |           |                     d
|j	                   t          |          \  }}|                     t           j        |           t          |          \  }}|                     t           j        |           t          |          \  }}|                     t           j        |           d S )N
createElementhtml   z	xmlns:xdczhttp://www.xml.com/bookstitlezIntroduction to XSLhrpz
xdc:author)r   parseStringSMALL_SAMPLEnext
assertTruehasattrassertEqualSTART_DOCUMENT
START_ELEMENTtagNamelen
attributesgetNamedItemvalue
CHARACTERSdataEND_ELEMENT)r   itemsevtnode
title_nodes        r   test_parse_semanticsz$PullDOMTestCase.test_parse_semantics+   s5   4#L11KK	To66777/555KK	T.444...C0011155kBBH(	* 	* 	*KK	T+S111KK	T 	
+S111KK	T$,///
KK	T+S111.	:::KK	T,c222$,///
d*+++KK	T+S111KK	T.444t|,,,KK	T,c222t|,,,KK	T+S111KK	T.444dl+++KK	T.444t|444KK	T+S111KK	T,c222t|444KK	T,c222KK	T+S111KK	T,c22222    c                 2   	 t          j        t                    }|D ]_\  }}|t           j        k    rJ|j        dk    r?|                    |           |                     dt          |j                              n`| 	                    d           |D ]\  }}|t           j        k    r n|                     d|j        d           |                    |           |                     t          |          d         t           j                   t          |          \  }}|                     |j        d           |                    |           t          |           t          |          \  }}|                     |j        d           |                     t                    5  t          |           d d d            n# 1 swxY w Y   |                                 |                     |j                   |                     |j                   d S )	Nr      z,No "title" element detected in SMALL_SAMPLE!r   z=expandNode did not leave DOMEventStream in the correct state.r   r   r   )r   r    r!   r'