Jump to content

_XMLDomWrapper.au3 ---> _XMLFileOpen ---> Failure


Totter
 Share

Recommended Posts

Hi I have problem with my code. 

_XMLFileOpen function failures with no error so I am not able to process XML.... (code -1; error 0)

Do anybody know, what is a problem?

code sample:

#include <_XMLDomWrapper.au3>


$XMLFile = @ScriptDir & "\distance.xml"
 If NOT FileExists($XMLFile) then Exit (Msgbox(0,"",$XMLFile & " does not exist"))
_XMLFileOpen($XMLFile)
ConsoleWrite("Xml file open " & _XMLFileOpen($XMLFile))
ConsoleWrite(@crlf & @Error & @crlf)
ConsoleWrite("Value" & _XMLGetValue("/DistanceMatrixResponse/row/element/distance/value"))
ConsoleWrite(@crlf & @Error & @crlf)
 
Xml file:
<DistanceMatrixResponse>
<status>OK</status>
<origin_address>Praha, Česká republika</origin_address>
<destination_address>Hradec Králové, Česká republika</destination_address>
<row>
<element>
<status>OK</status>
<duration>
<value>4344</value>
<text>1 hodin, 12 minut</text>
</duration>
<distance>
<value>112927</value>
<text>113 km</text>
</distance>
</element>
</row>
</DistanceMatrixResponse>

Output:

Xml file open -1
0 
Value-1
0

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...