tags:

views:

23

answers:

2

If I have a string which contains proper xml format and I want to convert it to an XML file so I can use Xpath to parse it properly.

How do I do this? please give me some valid example and i also want to load those each xml node value into Qtablewidgetitem how can i do..please help mee

A: 

There are several QDomDocument::setContent calls you can use to load data to a QDomDocument. The same document also lists an example: http://doc.trolltech.com/latest/itemviews-simpledommodel.html

Stephen Chu
A: 

I have a string which contains proper xml format and I want to convert it to an XML file

This requires a normal file writing which saved under the extension .xml. Check out the example given for file writing in the QFile for Qt 4.6.

i also want to load those each xml node value

For this you require QDomDocument, QDomElement etc., to retrieve the values and the nodes stored in the XML file.

Check out the examples given for QDomDocument documentation.

Hope it helps.

liaK