Re: Updating xml attribute
When one wants to have an easy-to-modify document structure that can be traversed and edited in any possible way (adding/removing/modifying elements/attributes...) it is highly recommened to use QDomDocument and related-classes. The stream-oriented classes are meant for fast parsing/writing of xml, not for any kind of editing...
Re: Updating xml attribute
Thanks,
I am using QDomDocument to create the xml, example :
Code:
QDomElement root
= doc.
createElement( "configuration" );
doc.appendChild( root );
root.appendChild( dbc );
root.appendChild( read );
// etc
and then using QTextStream to write the file.
I can't seem to find methods for actually amending the xml without having to re-create the dom...I know there must be some! Maybe setNodeValue?
Regards,
Steve
Re: Updating xml attribute
In QDomDocument, you have methods to look for elements (QDomElement), and this last class has setAttribute : that's what you need :)