Changes between Version 14 and Version 15 of BluePrint/Importer
- Timestamp:
- 04/08/10 03:20:36 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BluePrint/Importer
v14 v15 64 64 65 65 66 * Code to extract a text node by traversing all the siblings in a doc.(local-name(business in this case) should me known beforehand) 67 {{{ 66 68 69 import xml.dom.minidom 70 71 def get_a_document(name="/tmp/doc.xml"): 72 return xml.dom.minidom.parse(name) 73 74 75 def find_business_element(doc): 76 business_element = None 77 for e in doc.childNodes: 78 if e.nodeType == e.TEXT_NODE and e.localName == "business": 79 business_element = e 80 break 81 return business_element 82 }}} 83