PDA

View Full Version : reading XML



joseph
22nd January 2007, 10:10
hai all,

I need to read( as string ) the xml as follows




<parent>
<child attr1="00001 " attr2="PPPP" /> // only this row i need to pass to function
<child attr1="00002" attr2="qqqqq" />

</parent>



i need to pass this <child attr1="00001 " attr2="PPPP" /> as QString to a function , say

void foo( cosnt QString & xml );

please help me.

wysota
22nd January 2007, 10:30
Use QDomDocument and QDomElement. The attribute() method will help you get a grip on the value of each attribute.