Author: laukpe
Date: Mon Nov 24 03:18:48 2008
New Revision: 1077

Modified:
   trunk/src/robot/utils/javadomwrapper.py
   trunk/src/robot/utils/minidomwrapper.py

Log:
refactor

Modified: trunk/src/robot/utils/javadomwrapper.py
==============================================================================
--- trunk/src/robot/utils/javadomwrapper.py     (original)
+++ trunk/src/robot/utils/javadomwrapper.py     Mon Nov 24 03:18:48 2008
@@ -39,13 +39,15 @@
         self.name = node.tagName
         for item in self._create_list(node.attributes):
             self.attrs[item.name] = item.value
+        text = []
         for child in self._create_list(node.childNodes):
             if child.nodeType == child.ELEMENT_NODE:
                 self.children.append(DomWrapper(path, node=child))
             elif child.nodeType == child.TEXT_NODE:
-                self.text += child.data
+                text.append(child.data)
             elif child.nodeType != child.COMMENT_NODE:
raise TypeError("Unsupported node type: %s" % child.nodeType)
+        self.text = ''.join(text)

     def _get_dom(self, path, string):
         if path is not None:

Modified: trunk/src/robot/utils/minidomwrapper.py
==============================================================================
--- trunk/src/robot/utils/minidomwrapper.py     (original)
+++ trunk/src/robot/utils/minidomwrapper.py     Mon Nov 24 03:18:48 2008
@@ -38,13 +38,15 @@
             node = self._get_root(path, string)
         self.name = node.tagName
         self.attrs = dict(node.attributes.items())
+        text = []
         for child in node.childNodes:
             if child.nodeType == child.ELEMENT_NODE:
                 self.children.append(DomWrapper(path, node=child))
             elif child.nodeType == child.TEXT_NODE:
-                self.text += child.data
+                text.append(child.data)
             elif child.nodeType != child.COMMENT_NODE:
raise TypeError("Unsupported node type: %s" % child.nodeType)
+        self.text = ''.join(text)

     def _get_dom(self, path, string):
         if path is not None:

Reply via email to