I am trying to create an XML with QDomElement, like;
<?xml version="1.0"?>
<ECU>
<DATE DATE="mer. mai 2 2012"/>
<FILE/>
<CONFIGURATION>
<SESSION />
<TYPE TYPE="Défaut"/>
</CONFIGURATION>
<DETAILS>
<SELECTED-REQUESTS>
<TEST/>
<TIMEOUT/>
<SENT-TRAM />
<RECEIVED-TRAM/>
<POS-RESPONSE/>
<STATUS STATUS/>
</SELECTED-REQUESTS>
<SELECTED-REQUESTS>
<TEST/>
<TIMEOUT />
<SENT-TRAM />
<RECEIVED-TRAM />
<POS-RESPONSE />
<STATUS />
</SELECTED-REQUESTS>
</DETAILS>
</ECU>
The thing I could not do is that, I could not insert a text btw the tags, I can just add as an attribute;
<POS-RESPONSE POS-RESPONSE="77"/>
How can I add the value btw the tags with using QDomElement ?
Thanks a lot
See the documentation for
QDomNode::appendChild()which is inherited byQDomElement. You probably want to create a new node of typeQDomNode::TextNode, then append that as the child of the POS-RESPONSE tag node.