python (3.12.0)
ΑeT1 f 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 ej0 yy) 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 l e Zd Zd Zd Zd Zej d Zej d Z d Z
y)PullDOMTestCasec t j t }| j |j j
t
| t t d 5 }t
t j | ddd y# 1 sw Y yxY w)z&Minimal test of DOMEventStream.parse()rbN)r parsetstfile
addCleanupstreamcloselistopen)selfhandlerfins E/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_pulldom.py
test_parsezPullDOMTestCase.test_parse sc --(,,-W
'4
%Cs#$ % % %s BBc z t j t }t | \ }}| j t |d | j
t j | t | \ }}| j
t j | | j
d|j | j
dt |j | j
|j j d j d t | \ }}| j
t j | t | \ }}| j
t j | t | \ }}| j
d|j |}t | \ }}| j
t j | | j
d|j t | \ }}| j
t j | | j
d|j | j ||u t | \ }}| j
t j | t | \ }}| j
t j | | j
d|j t | \ }}| j
t j | | j
d|j t | \ }}| j
t j | t | \ }}| j
t j | | j
d |j t | \ }}| j
t j | | j
d
|j t | \ }}| j
t j | t | \ }}| j
t j | | j
d
|j t | \ }}| j
t j | t | \ }}| j
t j | t | \ }}| j
t j | y)z&Test DOMEventStream parsing semantics.
createElementhtml z xmlns:xdczhttp://www.xml.com/bookstitlezIntroduction to XSLhrpz
xdc:authorN)r parseStringSMALL_SAMPLEnext
assertTruehasattrassertEqualSTART_DOCUMENT
START_ELEMENTtagNamelen
attributesgetNamedItemvalue
CHARACTERSdataEND_ELEMENT)r itemsevtnode
title_nodes r test_parse_semanticsz$PullDOMTestCase.test_parse_semantics+ s ##L1K To67//5K T..4.C0155kBHH( *K T++S1K T
++S1K T$,,/
K T++S1. :K T,,c2$,,/
d*+K T++S1K T..4t||,K T,,c2t||,K T++S1K T..4dll+K T..4t||4K T++S1K T,,c2t||4K T,,c2K T++S1K T,,c2 c t j t }|D ]` \ }}|t j k( s|j dk( s*|j | | j
dt |j n | j d |D ] \ }}|t j k( s n | j
dj d |j | | j
t | d t j t | \ }}| j
|j d |j | t | t | \ }}| j
|j d | j t 5 t | d d d |j | j |j | j |j"