Qt 6.11 is out! See what's new in the release
blog
Regarding QDomDocument
General and Desktop
3
Posts
3
Posters
2.3k
Views
1
Watching
-
@
QDomDocument doc("QDNTest");
QDomProcessingInstruction xmlVers = doc.createProcessingInstruction("xml", "version="1.0" ");
doc.appendChild(xmlVers);
QDomElement root = doc.createElement("QDNTest");
doc.appendChild(root);
qDebug() << doc.toString();
@This creates output
@
<?xml version="1.0" ?>
<!DOCTYPE QDNTest>
<QDNTest/>
@To strip the DOCTYPE from the XML, construct the document without argument:
@
QDomDocument doc;
QDomProcessingInstruction xmlVers = doc.createProcessingInstruction("xml", "version="1.0" ");
doc.appendChild(xmlVers);
QDomElement root = doc.createElement("QDNTest");
doc.appendChild(root);
qDebug() << doc.toString();
@This creates output
@
<?xml version="1.0" ?>
<QDNTest/>
@