Core reclusive method for depth-first traversal without state
(node)
| 81 | |
| 82 | |
| 83 | def parse(node): |
| 84 | """Core reclusive method for depth-first traversal without state""" |
| 85 | s = "" |
| 86 | for child in node.childNodes: |
| 87 | if child.nodeType == xml.dom.Node.TEXT_NODE: |
| 88 | s += do_text(child) |
| 89 | elif child.nodeType == xml.dom.Node.DOCUMENT_TYPE_NODE: |
| 90 | s += parse_Document(child) |
| 91 | elif child.nodeType == xml.dom.Node.ELEMENT_NODE: |
| 92 | s += parse_Element(child) |
| 93 | return s |
| 94 | |
| 95 | |
| 96 | def html_fragment_to_wiki(html_fragment): |
no test coverage detected