Document why I didn't use ElementTree for now
This commit is contained in:
parent
ef0f1fe664
commit
339d04f659
1 changed files with 4 additions and 1 deletions
|
|
@ -21,7 +21,10 @@ import unittest
|
||||||
import scour
|
import scour
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
|
|
||||||
# helper function that performs a test on a given node and all its children
|
# I couldn't figure out how to get ElementTree to work with the following XPath
|
||||||
|
# "//*[namespace-uri()='http://example.com']"
|
||||||
|
# so I decided to use minidom and this helper function that performs a test on a given node
|
||||||
|
# and all its children
|
||||||
# func must return either True (if pass) or False (if fail)
|
# func must return either True (if pass) or False (if fail)
|
||||||
def walkTree(elem, func):
|
def walkTree(elem, func):
|
||||||
if func(elem) == False: return False
|
if func(elem) == False: return False
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue