@Dimitrij,
This needs fixing in the CI assignment plugin ?
???
It's all already there
def saveXML(self): try: fp = open(self.filename, 'w') fp.write("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n") fp.write("<ci>\n") fp.write("\t<slot>\n") fp.write("\t\t<id>%s</id>\n" % self.ci_slot) for item in self.selectedcaid: if len(self.selectedcaid): fp.write("\t\t<caid id=\"%s\" />\n" % item[0]) for item in self.servicelist: if len(self.servicelist): name = item[0].replace('<', '<') name = name.replace('&', '&') name = name.replace('>', '>') name = name.replace('"', '"') name = name.replace("'", ''') if item[2] == 1: fp.write("\t\t<provider name=\"%s\" dvbnamespace=\"%s\" />\n" % (stringToXML(name), item[3])) else: fp.write("\t\t<service name=\"%s\" ref=\"%s\" />\n" % (stringToXML(name), item[3])) fp.write("\t</slot>\n") fp.write("</ci>\n") fp.close() except: print("[CI_Config_CI%d] xml not written" % self.ci_slot) os.unlink(self.filename)
def stringToXML(text): illegal_xml_chars_RE = re.compile('[\x00-\x08\x0b\x0c\x0e-\x1F\uD800-\uDFFF\uFFFE\uFFFF]') if isinstance(text, (bytes, bytearray)): text = illegal_xml_chars_RE.sub('', text.decode('utf-8')) else: text = illegal_xml_chars_RE.sub('', text) return text.replace('&', '&').replace('<', '<').replace('>', '>').replace("'", ''').replace('"', '"')
Edited by Dimitrij, 4 December 2023 - 18:12.