Hello i want to parse a specific info from xml. In that xml code i want to read ForexBuying of the US DOLLAR. I get msgbox when it's US DOLLAR but i want to see its ForexBuying
I am quite new in vbscript please help me
Sub GetExchangeRate()
dim xmlDoc, Currencyy, plot, ForexBuying
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.load("C:\Users\BatuhanO\Desktop\exchange rate\tmp\exchange.xml")
Set Currencyy = xmlDoc.getElementsByTagName("CurrencyName")
If Currencyy.length > 0 then
For each x in Currencyy
if x.text="US DOLLAR" then
MsgBox(x.Text)
end if
Next
else
MsgBox("Parse Error")
End If
End Sub
Call GetExchangeRate()
<?xml version="1.0" encoding="ISO-8859-9"?>
<?xml-stylesheet type="text/xsl" href="isokur.xsl"?>
<Tarih_Date Tarih="01.10.2014" Date="10/01/2014" Bulten_No="2014/189">
<Currency CrossOrder="0" Kod="USD" CurrencyCode="USD">
<Unit>1</Unit>
<Isim>ABD DOLARI</Isim>
<CurrencyName>US DOLLAR</CurrencyName>
<ForexBuying>2.2829</ForexBuying>
<ForexSelling>2.2871</ForexSelling>
<BanknoteBuying>2.2813</BanknoteBuying>
<BanknoteSelling>2.2905</BanknoteSelling>
<CrossRateUSD>1</CrossRateUSD>
<CrossRateOther></CrossRateOther>
</Currency>
<Currency CrossOrder="1" Kod="AUD" CurrencyCode="AUD">
<Unit>1</Unit>
<Isim>AVUSTRALYA DOLARI</Isim>
<CurrencyName>AUSTRALIAN DOLLAR</CurrencyName>
<ForexBuying>1.9833</ForexBuying>
<ForexSelling>1.9962</ForexSelling>
<BanknoteBuying>1.9742</BanknoteBuying>
<BanknoteSelling>2.0082</BanknoteSelling>
<CrossRateUSD>1.1484</CrossRateUSD>
<CrossRateOther></CrossRateOther>
</Currency>
</Tarih_Date>
No comments:
Post a Comment