Jump to content
Sign in to follow this  

how to read a simple XML file with xmlDomWrapper

Recommended Posts


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"?>
  <title>something here</title>
  <title>something here too</title>

can someone please help me with this? with some examples?

thx a lot


PS: sry for my bad english :S

Edited by IvanDream

Share this post

Link to post
Share on other sites

Like this...


$XMLFILE = "Doc.xml"


$iCount = _XMLGetNodeCount("/response/data")

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)


Func _XMLGetFirstValue($node)

    Local $ret_val

    $ret_val = _XMLGetValue($node)
    If IsArray($ret_val) Then
        Return ($ret_val[1])
        Return SetError(1,3,0)


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...