Changes between Version 14 and Version 15 of BluePrint/Importer


Ignore:
Timestamp:
04/08/10 03:20:36 (15 years ago)
Author:
Nitin Rastogi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BluePrint/Importer

    v14 v15  
    6464
    6565
     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{{{
    6668
     69import xml.dom.minidom
     70
     71def get_a_document(name="/tmp/doc.xml"):
     72    return xml.dom.minidom.parse(name)
     73
     74
     75def 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