Regarding QDomDocument
General and Desktop
3
Posts
3
Posters
1.6k
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/>
@