Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QDomDocument.createTextNode



  • I am building a simple app in Qt 4.7 that uses QDomDocument to build xml files, the node content can actually contain html tags, like for example <br/> when I pass such string into createTextNode the '<' characters is correctly escape with &lt;, but the ending /> is left as is instead of being replaced with /&gt;. Is there a way to fix this?



  • This behavior is ok and creates a valid XML document. It's not needed to quote the ending > with > outside a CDATA section, according to the "XML standard":http://www.w3.org/TR/REC-xml/#syntax

    To answer your last question: No, there is no way to change this.


Log in to reply