+ # Define a handler for start element events
+ def StartElement(self, name, attrs ):
+ name = name.encode()
+
+ id = self.AppendItem(self.nodeStack[-1], name)
+ self.nodeStack.append(id)
+
+ def EndElement(self, name ):
+ self.nodeStack = self.nodeStack[:-1]
+
+ def CharacterData(self, data ):
+ if data.strip():
+ data = data.encode()
+
+ self.AppendItem(self.nodeStack[-1], data)
+