2
我使用QDomDocument来编写XML文档。
但在我的dom树中,有些节点是使用docA创建的,有些使用docB。是否有必要使用相同的QDomDocument创建的QDomElement来编写XML?
QDomElement parentNode = docA.CreateElement("name");//created by docA
QDomElement childNode = docB.CreateElement("value");//created by docB
parentNode.appendChild(childNode);//in onr tree
和:
QTextStream out(&file);
docA.save(out, Indent);//docA created the root QDomElement
//write the file using docA
所以是有可能写出整个树这样的XML?