I have the following code, which used to work perfectly, But now for somes reason, doesn't.
The XML I am reading is located at: https://forex.boi.org.il/currency.xml
The following code should parse the XMl and then save the USD/ILS exchange rate. As I say, it doesnt anymore, and I cant figure out whats wrong.
forexURL = "https://forex.boi.org.il/currency.xml"
getUSDRate = 0
MyRate = 0
Set xmlObj = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
xmlObj.async = False
xmlObj.setProperty "ServerHTTPRequest", True
xmlObj.Load(forexURL)
Set xmlList = xmlObj.getElementsByTagName("CURRENCY")
Set xmlObj = Nothing
x = 1
For Each xmlItem In xmlList
response.write "<p>" & xmlItem.childNodes(0).text
response.write "<p>" & xmlItem.childNodes(1).text
response.write "<p>" & xmlItem.childNodes(2).text
response.write "<p>" & xmlItem.childNodes(3).text
response.write "<p>" & xmlItem.childNodes(4).text
response.write "<p>" & xmlItem.childNodes(5).text
response.write "<p>___________________<br />" & x & "</p>"
if xmlItem.childNodes(2).text = "USD" then
MyRate = xmlItem.childNodes(4).text
exit for
end if
x = x +1
Next
Set xmlList = Nothing
For Each xmlItem In xmlListdoesn't event execute once. meaning it cannot find theCURRENCYtag. But it IS thereparseErrorproperty after an attemptedloadoperation.