Hi,<br><br>Maybe in a future, but I use this XML in many places on my app... and i dont have right now time for changing the code... Since i write and i read that file.<br><br>Thanks anyway...<br><br><div class="gmail_quote">
2008/12/5 Detlev Offenbach <span dir="ltr"><<a href="mailto:detlev@die-offenbachs.de">detlev@die-offenbachs.de</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
why not use the SAX based interface? I find the SAX approach easier to<br>
understand and to implement.<br>
<br>
Regards,<br>
Detlev<br>
<div><div></div><div class="Wj3C7c"><br>
On Freitag, 5. Dezember 2008, Gustavo A. Díaz wrote:<br>
> Hi guys,<br>
><br>
> I am facing a problem when how to read a XML with tags, and sub tags. Like<br>
> for example:<br>
><br>
> <FirstTag><br>
> <SecondTag><br>
> <data1>text</data1><br>
> <data2<text</data2><br>
> </SecondTag><br>
> <FristTag><br>
><br>
> The thing is that before I was using just one tag like:<br>
><br>
> <FirstTag><br>
> <data1>text</data1><br>
> <data2<text</data2><br>
> <FristTag><br>
><br>
> and I've found examples (of course in Qt docs) of how to achieve the<br>
> reading of this example of XML. But now i don't know how. And most cause i<br>
> am still newbie, and more working with XML files.<br>
><br>
> So, my old code is:<br>
><br>
> self.file = QFile(PREFERENCES_FILE)<br>
> self.file.open(QIODevice.ReadOnly)<br>
> self.doc = QDomDocument("OpenCoffee")<br>
> self.doc.setContent(self.file)<br>
> self.file.close()<br>
><br>
> self.docElem = self.doc.documentElement()<br>
> self.node = self.docElem.firstChild()<br>
><br>
> while (self.node.isNull() == False):<br>
> self.element = self.node.toElement()<br>
><br>
> if (self.element.isNull() == False):<br>
> if (self.element.tagName().contains("systemTray")):.... etc<br>
> etc.<br>
><br>
> But of course this will not work now, since i have to read trwo 2 tags<br>
> before searching the elements inside them.<br>
> Can someone give my a hand on this? i've droped this part of the code in my<br>
> app since i dont find any usefull clear example of how to do it.<br>
><br>
> Ataching my XML file.<br>
><br>
> Thanks a Lot.<br>
<br>
<br>
<br>
--<br>
</div></div><font color="#888888">Detlev Offenbach<br>
<a href="mailto:detlev@die-offenbachs.de">detlev@die-offenbachs.de</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Gustavo A. Díaz<br>GDNet Projects<br><a href="http://www.gdnet.com.ar">www.gdnet.com.ar</a><br>