[docs] Edits to Python 3.5.1: 20.8. xml.dom.pulldom

Matthew Cole mcole8 at binghamton.edu
Tue Mar 29 19:31:02 EDT 2016


Hello Documentation Maintainer,

1) Typo: 

In the code example for expandNode(node) in section 20.8.1, the following code appears:

xml = '<html><title>Foo</title> <p>Some text <div>and more</div></p> </html>’
doc = pulldom.parseString(xml)
for event, node in doc:
	if event == pulldom.START_ELEMENT and node.tagName == 'p':
		# Following statement only prints '<p/>'
		print(node.toxml())
		doc.exandNode(node)
		# Following statement prints node with all its children '<p>Some text <div>and more</div></p>'
		print(node.toxml())

The line reading doc.exandNode(node) should read doc.expandNode(node) instead.

2) Recommendation:

Also in section 20.8.1, in an above code sample from section 20.8, the import statement is shown:

from xml.dom import pulldom

The code sample in section 20.8.1 only works if you include that import statement, so may I recommend adding it?

Thanks for your hard work!

Regards,
Matthew Cole
Binghamton University
New York, USA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20160329/d94db648/attachment.html>


More information about the docs mailing list