I want to add one tag to an XML file, do as follows:
xmlFile = parse(paths)
tag = xmlFile.createElement("tag")
print "creado elemento materias"
tag.setAttribute("tagname" , listaString)
xmlFile.childNodes[0].appendChild( tag)
xmlFile.toprettyxml()
My goal is to add a string. The problem is that the code did not return errors but does not create the tag.
I have used as reference the question: add element with attributes in minidom python