python3.11-lxml/plans/etree-fromstring.py
Honza Horak e7e4023b14 Replace whole repo with latest content from branch rhel-8.8.0
Content corresponds with RHEL dist-git commit b4ada95
2023-05-15 16:42:12 +02:00

8 lines
170 B
Python

import lxml.etree as et
s = '<foo><bar baz="xyzzy">a<![CDATA[b]]>c</bar></foo>'
x = et.fromstring(s)
t = x.find('bar').text
print(t)
if t != 'abc':
raise Exception()