Totter Posted February 3, 2014 Share Posted February 3, 2014 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 More sharing options...
Totter Posted February 3, 2014 Author Share Posted February 3, 2014 Hi, Thanks All. Code works fine. Problem was with Xml file. I saved that file with copy->paste from web browser. When I saved file directly, It worked fine (save link as). 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