This is my xml file:
How can I read only the the element <b>version</b> of the first node? Note that 3er party application or even the user can change the position or edit this element.Code:<?xml version='1.0' encoding='UTF-8' standalone='yes'?> <installers> <installer id='1' size='1.6' sizetype='MB'> <name>Windows Installer for Windows</name> <version>2.0</version> <os>Win9xMe</os> <url>http://download.microsoft.com/download/WindowsInstaller/Install/2.0/W9XMe/EN-US/InstMsiA.exe</url> </installer> <installer id='2' size='1.0' sizetype='MB'> <name>SSE Setup</name> <version>4.0</version> <os>Win9xMe2kXP</os> <url>http://www.ssesetup.com/downloads/SSESetup40.exe</url> </installer> <installer id='3' size='1.4' sizetype='MB'> <name>SSE Setup</name> <version>2.17</version> <os>Win9xMe2kXP</os> <url>http://puzzle.dl.sourceforge.net/sourceforge/nsis/nsis-2.17-setup.exe</url> </installer> </installers>
Right now I use this:
But, as I said, it can be modified by externals.Code:pDoc->getElementsByTagName("installer")->Getitem(0)->childNodes->Getitem(1)->text
Thanks