By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

XML with no ID

P: n/a
Hi . My problem is that I have XML provided to me by URL but there are
no ID tags. How do I loop through and find a specific value in the XML?
The site I'm working on uses classic ASP. Here is my code and the xml
that is returned by the URL

<%'--------------------------------------%>
URL = "http://www.forex.se/ratesxml.asp?id=269"
set xmlhttp = CreateObject("Microsoft.XMLHTTP")
xmlhttp.open "GET", URL, false
xmlhttp.send ""
result = xmlhttp.responseText
Response.Write result
<%'------------- so far so good.---%>

here my problems start. I usually use getElementsByTagName but it just
won't work here since the xml doesn't seem to have ID's. How do I do to
for example get the value of EUR for SEK in the file? The entire
response XML is pasted bellow .

Set xmlDoc = CreateObject("Microsoft.xmldom")
xmlDoc.async = False
xmlDoc.loadXML(result)
'what to do....

Thank you!

<?xml version="1.0" encoding="iso-8859-1"?><web_dis_rates><timestamp
Desc="Senast uppdaterad:">2006-03-17
17:00</timestamp><row><swift_code>AED</swift_code><swift_name>arabiska
Dirham</swift_name><multiply>1</multiply><buy_cash>2,0414</buy_cash><buy_tc>-</buy_tc><sell_cash>2,2121</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="AED"
Amount="100">45,21</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>AUD</swift_code><swift_name>australienska
Dollar</swift_name><multiply>1</multiply><buy_cash>5,5315</buy_cash><buy_tc>5,4762</buy_tc><sell_cash>5,8362</sell_cash><sell_tc>5,8362</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="AUD"
Amount="100">17,13</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>BBD</swift_code><swift_name>Barbados
Dollar</swift_name><multiply>1</multiply><buy_cash>3,7838</buy_cash><buy_tc>-</buy_tc><sell_cash>4,1495</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="BBD"
Amount="100">24,10</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>BGN</swift_code><swift_name>bulgariska
Lev
(New)</swift_name><multiply>1</multiply><buy_cash>4,6278</buy_cash><buy_tc>-</buy_tc><sell_cash>4,9464</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="BGN"
Amount="100">20,22</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>BHD</swift_code><swift_name>Dinar</swift_name><multiply>1</multiply><buy_cash>18,6681</buy_cash><buy_tc>-</buy_tc><sell_cash>21,3382</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="BHD"
Amount="100">4,69</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>BRL</swift_code><swift_name>Brasilianska
Real</swift_name><multiply>1</multiply><buy_cash>3,5995</buy_cash><buy_tc>-</buy_tc><sell_cash>3,9242</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="BRL"
Amount="100">25,48</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>BSD</swift_code><swift_name>Bahamas
Dollar</swift_name><multiply>1</multiply><buy_cash>7,4055</buy_cash><buy_tc>-</buy_tc><sell_cash>8,1624</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="BSD"
Amount="100">12,25</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>CAD</swift_code><swift_name>Kanadensiska
Dollar</swift_name><multiply>1</multiply><buy_cash>6,571</buy_cash><buy_tc>6,5052</buy_tc><sell_cash>6,775</sell_cash><sell_tc>6,775</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="CAD"
Amount="100">14,76</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>CHF</swift_code><swift_name>Schweiziska
Francs</swift_name><multiply>1</multiply><buy_cash>5,8713</buy_cash><buy_tc>5,8126</buy_tc><sell_cash>6,0208</sell_cash><sell_tc>6,0208</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="CHF"
Amount="100">16,61</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>CLP</swift_code><swift_name>Chilenska
Peso</swift_name><multiply>1</multiply><buy_cash>0,0142</buy_cash><buy_tc>-</buy_tc><sell_cash>0,0158</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="CLP"
Amount="100">6?329,11</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>CNY</swift_code><swift_name>kinesiska
Yuan</swift_name><multiply>1</multiply><buy_cash>0,9267</buy_cash><buy_tc>-</buy_tc><sell_cash>1,0049</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="CNY"
Amount="100">99,51</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>CYP</swift_code><swift_name>cypriotiska
Pund</swift_name><multiply>1</multiply><buy_cash>16,0905</buy_cash><buy_tc>15,9296</buy_tc><sell_cash>16,6466</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="CYP"
Amount="100">6,01</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>CZK</swift_code><swift_name>tjeckiska
Koruna</swift_name><multiply>1</multiply><buy_cash>0,3199</buy_cash><buy_tc>-</buy_tc><sell_cash>0,3394</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="CZK"
Amount="100">294,64</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>DKK</swift_code><swift_name>danska
Kronor</swift_name><multiply>1</multiply><buy_cash>1,236</buy_cash><buy_tc>-</buy_tc><sell_cash>1,267</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="DKK"
Amount="100">78,93</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>DOP</swift_code><swift_name>Dominikanska
Peso
Oro</swift_name><multiply>1</multiply><buy_cash>0,2161</buy_cash><buy_tc>-</buy_tc><sell_cash>0,255</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="DOP"
Amount="100">392,16</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>EEK</swift_code><swift_name>estniska
Kroon</swift_name><multiply>1</multiply><buy_cash>0,582</buy_cash><buy_tc>-</buy_tc><sell_cash>0,6126</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="EEK"
Amount="100">163,24</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>EGP</swift_code><swift_name>egyptiska
Pund</swift_name><multiply>1</multiply><buy_cash>1,2892</buy_cash><buy_tc>-</buy_tc><sell_cash>1,436</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="EGP"
Amount="100">69,64</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>EUR</swift_code><swift_name>Euro</swift_name><multiply>1</multiply><buy_cash>9,2486</buy_cash><buy_tc>9,1561</buy_tc><sell_cash>9,5274</sell_cash><sell_tc>9,5274</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="EUR"
Amount="100">10,50</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>FJD</swift_code><swift_name>Fiji
Dollar</swift_name><multiply>1</multiply><buy_cash>4,0337</buy_cash><buy_tc>-</buy_tc><sell_cash>4,7045</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="FJD"
Amount="100">21,26</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>GBP</swift_code><swift_name>engelska
Pund</swift_name><multiply>1</multiply><buy_cash>13,3165</buy_cash><buy_tc>13,1834</buy_tc><sell_cash>13,7335</sell_cash><sell_tc>13,7335</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="GBP"
Amount="100">7,28</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>GMD</swift_code><swift_name>Gambianska
Dalasi</swift_name><multiply>1</multiply><buy_cash>0,2488</buy_cash><buy_tc>-</buy_tc><sell_cash>0,2936</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="GMD"
Amount="100">340,60</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>HKD</swift_code><swift_name>Hongkong
Dollar</swift_name><multiply>1</multiply><buy_cash>0,9507</buy_cash><buy_tc>-</buy_tc><sell_cash>1,0375</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="HKD"
Amount="100">96,39</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>HRK</swift_code><swift_name>kroatiska
Kuna</swift_name><multiply>1</multiply><buy_cash>1,2611</buy_cash><buy_tc>-</buy_tc><sell_cash>1,3381</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="HRK"
Amount="100">74,73</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>HUF</swift_code><swift_name>ungerska
Forint</swift_name><multiply>1</multiply><buy_cash>0,0351</buy_cash><buy_tc>-</buy_tc><sell_cash>0,0375</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="HUF"
Amount="100">2?666,67</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>IDR</swift_code><swift_name>indonesiska
Rupiah</swift_name><multiply>100</multiply><buy_cash>0,0776</buy_cash><buy_tc>-</buy_tc><sell_cash>0,0901</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="IDR"
Amount="100">110?987,79</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>ILS</swift_code><swift_name>israeliska
NewSheqel</swift_name><multiply>1</multiply><buy_cash>1,5553</buy_cash><buy_tc>-</buy_tc><sell_cash>1,7459</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="ILS"
Amount="100">57,28</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>INR</swift_code><swift_name>indiska
Rupee</swift_name><multiply>1</multiply><buy_cash>0,1637</buy_cash><buy_tc>-</buy_tc><sell_cash>0,1866</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="INR"
Amount="100">535,91</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>ISK</swift_code><swift_name>isl?ska
Kr?</swift_name><multiply>1</multiply><buy_cash>0,1064</buy_cash><buy_tc>-</buy_tc><sell_cash>0,1152</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="ISK"
Amount="100">868,06</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>JOD</swift_code><swift_name>Jordanska
Dinar</swift_name><multiply>1</multiply><buy_cash>10,4464</buy_cash><buy_tc>-</buy_tc><sell_cash>11,642</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="JOD"
Amount="100">8,59</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>JPY</swift_code><swift_name>japanska
Yen</swift_name><multiply>100</multiply><buy_cash>6,4878</buy_cash><buy_tc>6,4229</buy_tc><sell_cash>6,7072</sell_cash><sell_tc>6,7072</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="JPY"
Amount="100">1?490,94</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>KES</swift_code><swift_name>kenyanska
Shilling</swift_name><multiply>1</multiply><buy_cash>0,104</buy_cash><buy_tc>-</buy_tc><sell_cash>0,1135</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="KES"
Amount="100">881,06</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>KRW</swift_code><swift_name>Koreanska
Won</swift_name><multiply>1</multiply><buy_cash>0,0071</buy_cash><buy_tc>-</buy_tc><sell_cash>0,0084</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="KRW"
Amount="100">11?904,76</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>KWD</swift_code><swift_name>Kuwait
Dinar</swift_name><multiply>1</multiply><buy_cash>21,04</buy_cash><buy_tc>-</buy_tc><sell_cash>27,6765</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="KWD"
Amount="100">3,61</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>LKR</swift_code><swift_name>Sri
Lankanska
Rupee</swift_name><multiply>1</multiply><buy_cash>0,0716</buy_cash><buy_tc>-</buy_tc><sell_cash>0,0807</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="LKR"
Amount="100">1?239,16</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>LTL</swift_code><swift_name>Litauiska
Litas</swift_name><multiply>1</multiply><buy_cash>2,5973</buy_cash><buy_tc>-</buy_tc><sell_cash>2,788</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="LTL"
Amount="100">35,87</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>LVL</swift_code><swift_name>Lettiska
Lats</swift_name><multiply>1</multiply><buy_cash>12,9077</buy_cash><buy_tc>-</buy_tc><sell_cash>13,851</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="LVL"
Amount="100">7,22</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>MTL</swift_code><swift_name>Malta
Lira</swift_name><multiply>1</multiply><buy_cash>20,8082</buy_cash><buy_tc>-</buy_tc><sell_cash>22,5192</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="MTL"
Amount="100">4,44</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>MUR</swift_code><swift_name>Mauritius
Rupee</swift_name><multiply>1</multiply><buy_cash>0,2408</buy_cash><buy_tc>-</buy_tc><sell_cash>0,2674</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="MUR"
Amount="100">373,97</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>MXN</swift_code><swift_name>Mexicanska
Peso</swift_name><multiply>1</multiply><buy_cash>0,7014</buy_cash><buy_tc>-</buy_tc><sell_cash>0,7711</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="MXN"
Amount="100">129,68</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>MYR</swift_code><swift_name>Malaysiska
Ringgit</swift_name><multiply>1</multiply><buy_cash>2,0061</buy_cash><buy_tc>-</buy_tc><sell_cash>2,2026</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="MYR"
Amount="100">45,40</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>NOK</swift_code><swift_name>Norska
Kroner</swift_name><multiply>1</multiply><buy_cash>1,1437</buy_cash><buy_tc>1,1322</buy_tc><sell_cash>1,1855</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="NOK"
Amount="100">84,35</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>NZD</swift_code><swift_name>Nya
Zeel?ska
Dollar</swift_name><multiply>1</multiply><buy_cash>4,7675</buy_cash><buy_tc>-</buy_tc><sell_cash>5,1061</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="NZD"
Amount="100">19,58</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>PHP</swift_code><swift_name>filippinska
Peso</swift_name><multiply>1</multiply><buy_cash>0,1469</buy_cash><buy_tc>-</buy_tc><sell_cash>0,1618</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="PHP"
Amount="100">618,05</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>PLN</swift_code><swift_name>Polska
NewZloty</swift_name><multiply>1</multiply><buy_cash>2,374</buy_cash><buy_tc>-</buy_tc><sell_cash>2,5261</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="PLN"
Amount="100">39,59</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>ROL</swift_code><swift_name>Rum?ka
Lei</swift_name><multiply>100</multiply><buy_cash>0,0242</buy_cash><buy_tc>-</buy_tc><sell_cash>0,0277</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="ROL"
Amount="100">361?010,83</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>RON</swift_code><swift_name>rum?ka
Lei
(new)</swift_name><multiply>1</multiply><buy_cash>2,5843</buy_cash><buy_tc>-</buy_tc><sell_cash>2,7678</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="RON"
Amount="100">36,13</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>RUB</swift_code><swift_name>ryska
Rubel</swift_name><multiply>1</multiply><buy_cash>0,2671</buy_cash><buy_tc>-</buy_tc><sell_cash>0,2929</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="RUB"
Amount="100">341,41</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>SAR</swift_code><swift_name>Saudiarabiska
Riyal</swift_name><multiply>1</multiply><buy_cash>1,9243</buy_cash><buy_tc>1,905</buy_tc><sell_cash>2,1362</sell_cash><sell_tc>2,1362</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="SAR"
Amount="100">46,81</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>SGD</swift_code><swift_name>singapore
Dollar</swift_name><multiply>1</multiply><buy_cash>4,6579</buy_cash><buy_tc>-</buy_tc><sell_cash>4,9501</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="SGD"
Amount="100">20,20</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>SIT</swift_code><swift_name>slovenska
Tolar</swift_name><multiply>1</multiply><buy_cash>0,0377</buy_cash><buy_tc>-</buy_tc><sell_cash>0,0412</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="SIT"
Amount="100">2?427,18</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>SKK</swift_code><swift_name>slovakiska
Koruna</swift_name><multiply>1</multiply><buy_cash>0,2394</buy_cash><buy_tc>-</buy_tc><sell_cash>0,261</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="SKK"
Amount="100">383,14</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>THB</swift_code><swift_name>thail?ska
Baht</swift_name><multiply>1</multiply><buy_cash>0,1875</buy_cash><buy_tc>-</buy_tc><sell_cash>0,203</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="THB"
Amount="100">492,61</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>TRY</swift_code><swift_name>Turkiska
nya
Lira</swift_name><multiply>1</multiply><buy_cash>5,6431</buy_cash><buy_tc>-</buy_tc><sell_cash>5,9965</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="TRY"
Amount="100">16,68</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>TTD</swift_code><swift_name>Trinidad
+ Tobago
Dollar</swift_name><multiply>1</multiply><buy_cash>1,2027</buy_cash><buy_tc>-</buy_tc><sell_cash>1,3183</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="TTD"
Amount="100">75,86</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>TWD</swift_code><swift_name>Taiwanesiska
New
Dollar</swift_name><multiply>1</multiply><buy_cash>0,2281</buy_cash><buy_tc>-</buy_tc><sell_cash>0,2548</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="TWD"
Amount="100">392,46</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>USD</swift_code><swift_name>amerikanska
Dollar</swift_name><multiply>1</multiply><buy_cash>7,5694</buy_cash><buy_tc>7,4937</buy_tc><sell_cash>7,841</sell_cash><sell_tc>7,841</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="USD"
Amount="100">12,75</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>XCD</swift_code><swift_name>?t
Karibiska
Dollar</swift_name><multiply>1</multiply><buy_cash>2,7967</buy_cash><buy_tc>-</buy_tc><sell_cash>3,1168</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="XCD"
Amount="100">32,08</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>XOF</swift_code><swift_name>v?afrikanska
Franc</swift_name><multiply>1</multiply><buy_cash>0,0128</buy_cash><buy_tc>-</buy_tc><sell_cash>0,0157</sell_cash><sell_tc>-</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="XOF"
Amount="100">6?369,43</CurrencyGuide><base_swift>SEK</base_swift></row><row><swift_code>ZAR</swift_code><swift_name>sydafrikanska
Rand</swift_name><multiply>1</multiply><buy_cash>1,1965</buy_cash><buy_tc>1,1845</buy_tc><sell_cash>1,303</sell_cash><sell_tc>1,303</sell_tc><CurrencyGuide
BaseSwift="SEK" Swift="ZAR"
Amount="100">76,75</CurrencyGuide><base_swift>SEK</base_swift></row><copyright>Copyright
FOREX 2006</copyright></web_dis_rates>

Mar 20 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ho**@havet.se wrote:
Hi . My problem is that I have XML provided to me by URL but there are
no ID tags. How do I loop through and find a specific value in the XML?


Use an XPath query, if your system supports XPath. Or write a program
that navigates the document and searches for those values, using either
the DOM or SAX APIs, depending on which your system supports.

There are lots of good tutorials on all three on the web.

Without knowing more about the environment in which you're writing this,
it's hard to say more than that.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Mar 20 '06 #2

P: n/a
ho**@havet.se wrote:
Hi . My problem is that I have XML provided to me by URL but there are
no ID tags. How do I loop through and find a specific value in the XML?
The site I'm working on uses classic ASP. Here is my code and the xml
that is returned by the URL

<%'--------------------------------------%>
URL = "http://www.forex.se/ratesxml.asp?id=269"
set xmlhttp = CreateObject("Microsoft.XMLHTTP")
xmlhttp.open "GET", URL, false
xmlhttp.send ""
result = xmlhttp.responseText
Response.Write result
<%'------------- so far so good.---%>

here my problems start. I usually use getElementsByTagName but it just
won't work here since the xml doesn't seem to have ID's.
Elements don't normally have ID attributes unless they are specially
interesting.
How do I do to
for example get the value of EUR for SEK in the file? The entire
response XML is pasted bellow .


The element you are presumably interested in is

<row>
<swift_code>EUR</swift_code>
<swift_name>Euro</swift_name>
<multiply>1</multiply>
<buy_cash>9,2486</buy_cash>
<buy_tc>9,1561</buy_tc>
<sell_cash>9,5274</sell_cash>
<sell_tc>9,5274</sell_tc>
<CurrencyGuide BaseSwift="SEK" Swift="EUR"
Amount="100">10,50</CurrencyGuide>
<base_swift>SEK</base_swift>
</row>

right?

Just use an XPath statement like
//row[swift_code='EUR'][base_swift='SEK']/buy_cash
(or whatever element you're interested in at the end).

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Mar 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.