IvanDream Posted October 2, 2010 Share Posted October 2, 2010 (edited) Hi i never used XML and i don't know how to read a xml file properly... i found the _XMLDomWrapper.au3 but i don't understand how to use it i just want to read data from an xml like this: <?xml version="1.0" encoding="utf-8"?> <response> <count>21</count> <data> <firts>123434</first> <second>2342355</second> <title>something here</title> <url>http://asd.asd</url> </data> <data> <firts>745464</first> <second>574456</second> <title>something here too</title> <url>http://gfh.com/as/</url> </data> <data> .......... </data> ...... ...... </response> can someone please help me with this? with some examples? thx a lot Ivan PS: sry for my bad english :S Edited October 2, 2010 by IvanDream Link to comment Share on other sites More sharing options...
IvanDream Posted October 2, 2010 Author Share Posted October 2, 2010 nobody can help me? Link to comment Share on other sites More sharing options...
ChrisL Posted October 2, 2010 Share Posted October 2, 2010 Like this... #include"_XMLDomWrapper.au3" $XMLFILE = "Doc.xml" _XMLFileOpen($XMLFILE) $iCount = _XMLGetNodeCount("/response/data") Msgbox(0,"",$iCount) For $i = 1 to $iCount $first = _XMLGetFirstValue("/response/data[" & $i & "]/first") $second = _XMLGetFirstValue("/response/data[" & $i & "]/second") $title = _XMLGetFirstValue("/response/data[" & $i & "]/title") $url = _XMLGetFirstValue("/response/data[" & $i & "]/url") MsgBox(0,"", $first & @crlf & $second & @crlf & $title & @crlf & $url) Next Func _XMLGetFirstValue($node) Local $ret_val $ret_val = _XMLGetValue($node) If IsArray($ret_val) Then Return ($ret_val[1]) Else Return SetError(1,3,0) EndIf EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
IvanDream Posted October 3, 2010 Author Share Posted October 3, 2010 perfect! thx this is exactly wht i need Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now