- # skip null children
- if not childName:
- continue
- # initialize the possible array of children
- if not node[elementName].has_key(childName):
- node[elementName][childName] = []
- # if child node has text child nodes
- # append the children to the array as strings
- if child.hasChildNodes() and isinstance(child.childNodes[0], minidom.Text):
- for nextchild in child.childNodes:
+
+ # skip null children
+ if not childName: continue
+
+ # initialize the possible array of children
+ if not node[elementName].has_key(childName): node[elementName][childName] = []
+
+ if isinstance(child, minidom.Text):
+ # add if data is not empty
+ if child.data.strip():