Hallo
Kann mir irgendjemand helfen aus dieser Datei den USD Kurs herauszuparsen.
Bin Anfänger mit xml
Habs so probiert:
Kann mir irgendjemand helfen aus dieser Datei den USD Kurs herauszuparsen.
Bin Anfänger mit xml
Habs so probiert:
C#:
string DateiPfad = "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml";
XmlDocument doc = new XmlDocument();
doc.Load(DateiPfad_eu);
XmlNode USD = doc.SelectSingleNode("/Cube/Cube/Cube[@currency='USD']");
if (USD != null)
XML:
<?xml version="1.0" encoding="UTF-8"?>
<gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref">
<gesmes:subject>Reference rates</gesmes:subject>
<gesmes:Sender>
<gesmes:name>European Central Bank</gesmes:name>
</gesmes:Sender>
<Cube>
<Cube time='2008-04-25'>
<Cube currency='USD' rate='1.5596'/>
<Cube currency='JPY' rate='163.01'/>
<Cube currency='BGN' rate='1.9558'/>
<Cube currency='CZK' rate='25.254'/>
<Cube currency='DKK' rate='7.4627'/>
<Cube currency='EEK' rate='15.6466'/>
<Cube currency='GBP' rate='0.78605'/>
<Cube currency='HUF' rate='252.90'/>
<Cube currency='LTL' rate='3.4528'/>
<Cube currency='LVL' rate='0.6979'/>
<Cube currency='PLN' rate='3.4270'/>
<Cube currency='RON' rate='3.6195'/>
<Cube currency='SEK' rate='9.3380'/>
<Cube currency='SKK' rate='32.415'/>
<Cube currency='CHF' rate='1.6170'/>
<Cube currency='ISK' rate='115.00'/>
<Cube currency='NOK' rate='8.0240'/>
<Cube currency='HRK' rate='7.2630'/>
<Cube currency='RUB' rate='36.8890'/>
<Cube currency='TRY' rate='2.0131'/>
<Cube currency='AUD' rate='1.6744'/>
<Cube currency='BRL' rate='2.6197'/>
<Cube currency='CAD' rate='1.5861'/>
<Cube currency='CNY' rate='10.9328'/>
<Cube currency='HKD' rate='12.1556'/>
<Cube currency='IDR' rate='14387.31'/>
<Cube currency='KRW' rate='1551.41'/>
<Cube currency='MXN' rate='16.3134'/>
<Cube currency='MYR' rate='4.9213'/>
<Cube currency='NZD' rate='1.9992'/>
<Cube currency='PHP' rate='65.378'/>
<Cube currency='SGD' rate='2.1295'/>
<Cube currency='THB' rate='49.455'/>
<Cube currency='ZAR' rate='11.9151'/>
</Cube>
</Cube>
</gesmes:Envelope>
Zuletzt bearbeitet von einem Moderator: