more changes for service groups (replacement for zapping alternatives
[enigma2.git] / lib / python / Tools / XMLTools.py
index aaab4677f4887dcbaea4ac5f48d12ef2a4053718..72b90388a4b75a342a25b037f00c49322a6a47a5 100644 (file)
@@ -15,3 +15,13 @@ def elementsWithTag(el, tag):
                        continue
                if tag(x.tagName):
                        yield x
+
+def mergeText(nodelist):
+       rc = ""
+       for node in nodelist:
+               if node.nodeType == node.TEXT_NODE:
+                       rc = rc + node.data
+       return rc
+
+def stringToXML(text):
+       return text.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace("'", '&apos;').replace('"', '&quot;')