mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
validation fiddling
This commit is contained in:
@@ -240,10 +240,10 @@ from here on out, use lxml.etree explicitly because these functions are specific
|
||||
<pre class=screen>
|
||||
>>> title = lxml.etree.SubElement(new_feed, "title", attrib={"type":"html"})
|
||||
>>> print(lxml.etree.tounicode(new_feed))
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html"/></feed>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html"/></feed>
|
||||
>>> title.text = "dive into mark"
|
||||
>>> print(lxml.etree.tounicode(new_feed))
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">dive into mark</title></feed>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">dive into mark</title></feed>
|
||||
>>> print(lxml.etree.tounicode(new_feed, pretty_print=True))
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
|
||||
<title type="html">dive into mark</title>
|
||||
|
||||
Reference in New Issue
Block a user