diff src/tools/xml_tools.py @ 1456:a13be5c22334

xml_tools: minor attribute renaming
author Goffi <goffi@goffi.org>
date Sat, 15 Aug 2015 22:27:39 +0200
parents 8ce9924fa92c
children c005c212b538
line wrap: on
line diff
--- a/src/tools/xml_tools.py	Sat Aug 15 22:24:40 2015 +0200
+++ b/src/tools/xml_tools.py	Sat Aug 15 22:27:39 2015 +0200
@@ -1105,10 +1105,10 @@
     Found at http://stackoverflow.com/questions/2093400/how-to-create-twisted-words-xish-domish-element-entirely-from-raw-xml/2095942#2095942
     (c) Karl Anderson"""
 
-    def __call__(self, string, force_spaces=False):
+    def __call__(self, raw_xml, force_spaces=False):
         """
-        @param string: the XML string
-        @param force_spaces: if True, replace occurrences of 'n' and '\t' with ' '.
+        @param raw_xml(unicode): the raw XML
+        @param force_spaces: if True, replace occurrences of '\n' and '\t' with ' '.
         """
         self.result = None
 
@@ -1127,7 +1127,7 @@
         parser.DocumentEndEvent = onEnd
         tmp = domish.Element((None, "s"))
         if force_spaces:
-            string = string.replace('\n', ' ').replace('\t', ' ')
-        tmp.addRawXml(string)
+            raw_xml = raw_xml.replace('\n', ' ').replace('\t', ' ')
+        tmp.addRawXml(raw_xml)
         parser.parse(tmp.toXml().encode('utf-8'))
         return self.result.firstChildElement()