Re: [WebDNA] XML Help please

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 101918
interpreted = N
texte = Hi, Thanks very much for sharing your code, it's just what I need, Regards, Colin Gil Poulsen wrote: > I just redid mine to use the ECB as opposed to the Fed Bank of NY, turns > out they stopped providing the feeds earlier this year. I am using this > to get six different exchange rates and then converting them so they are > relative to the USD (the ECB feeds are based on the Euro, not the U.S. > dollar). So this might or might not help, but I figured I'd post it. > FWIW, the XML used by the ECB to post the rates uses XML attributes for > the currency and value so the parsing of the XML is somewhat different > than it would have been if they did it in a more straightforward way. > > > > > [TCPConnect host=www.ecb.europa.eu&port=80] > [text show=F]ex_rates=[TCPSend skipheader=T]GET > /stats/eurofxref/eurofxref-daily.xml > HTTP/1.0[unURL]%0D%0A%0D%0A[/unURL][/TCPSend][/text] > [/TCPConnect] > > [xmlparse var=xml_rates][ex_rates][/xmlparse] > > > [xmlNodes ref=xml_rates&path=named:gesmes:Envelope/Cube/Cube] > > [text show=F][showIf > [xmlNodeAttributes][value][/xmlNodeAttributes]^USD]USD=[middle > startAfter=&endBefore=U][xmlNodeAttributes][value][/xmlNodeAttributes][/middle][/showIf][/text] > > [text show=F][showIf > [xmlNodeAttributes][value][/xmlNodeAttributes]^AUD]AUD=[middle > startAfter=&endBefore=A][xmlNodeAttributes][value][/xmlNodeAttributes][/middle][/showIf][/text] > > [text show=F][showIf > [xmlNodeAttributes][value][/xmlNodeAttributes]^GBP]GBP=[middle > startAfter=&endBefore=G][xmlNodeAttributes][value][/xmlNodeAttributes][/middle][/showIf][/text] > > [text show=F][showIf > [xmlNodeAttributes][value][/xmlNodeAttributes]^NZD]NZD=[middle > startAfter=&endBefore=N][xmlNodeAttributes][value][/xmlNodeAttributes][/middle][/showIf][/text] > > [text show=F][showIf > [xmlNodeAttributes][value][/xmlNodeAttributes]^CAD]CAD=[middle > startAfter=&endBefore=C][xmlNodeAttributes][value][/xmlNodeAttributes][/middle][/showIf][/text] > > [/xmlNodes] > > > [text show=F]EUR=[format 0.3f][math]1.00/[USD][/math][/format][/text] > > > [writeFile /includes/EUR.inc][EUR][/writeFile] > [writeFile /includes/AUD.inc][format > 0.3f][math][AUD]*[EUR][/math][/format][/writeFile] > [writeFile /includes/GBP.inc][format > 0.3f][math][GBP]*[EUR][/math][/format][/writeFile] > [writeFile /includes/NZD.inc][format > 0.3f][math][NZD]*[EUR][/math][/format][/writeFile] > [writeFile /includes/CAD.inc][format > 0.3f][math][CAD]*[EUR][/math][/format][/writeFile] > > > > On Feb 3, 2009, at 6:58 AM, Colin Sidwell wrote: > >> Hi, >> >> On the off chance, has anyone written any code to parse this feed from >> the >> European Central Bank? >> >> http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml >> >> I want to just get the USD exchange rate out of it. >> >> I did some XML code before but it took about 2 days to get it working :-( >> >> >> Regards, >> >> Colin >> >> >> >> All services are subject to our terms & conditions, a copy of which >> can be >> found on our web site at http://www.idealinternet.co.uk/ >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> old archives: http://dev.webdna.us/TalkListArchive/ >> > > -- > Gil Poulsen, Mac Wirehead > > ************************ > AltiM@c Consulting > 23 Marco Polo Court > Franklin Park, NJ 08823-1703 > Voice: 609-359-0103 > http://altimac.com > ************************ > > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > old archives: http://dev.webdna.us/TalkListArchive/ > Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] XML Help please (Colin Sidwell 2009)
  2. Re: [WebDNA] XML Help please (Gil Poulsen 2009)
  3. Re: [WebDNA] XML Help please (Gil Poulsen 2009)
  4. Re: [WebDNA] XML Help please (Gil Poulsen 2009)
  5. RE: [WebDNA] XML Help please ("Michael A. DeLorenzo" 2009)
  6. RE: [WebDNA] XML Help please ("Michael A. DeLorenzo" 2009)
  7. Re: [WebDNA] XML Help please (Colin Sidwell 2009)
  8. Re: [WebDNA] XML Help please (Colin Sidwell 2009)
  9. Re: [WebDNA] XML Help please (Gil Poulsen 2009)
  10. Re: [WebDNA] XML Help please (Toby Cox 2009)
  11. [WebDNA] XML Help please (Colin Sidwell 2009)
Hi, Thanks very much for sharing your code, it's just what I need, Regards, Colin Gil Poulsen wrote: > I just redid mine to use the ECB as opposed to the Fed Bank of NY, turns > out they stopped providing the feeds earlier this year. I am using this > to get six different exchange rates and then converting them so they are > relative to the USD (the ECB feeds are based on the Euro, not the U.S. > dollar). So this might or might not help, but I figured I'd post it. > FWIW, the XML used by the ECB to post the rates uses XML attributes for > the currency and value so the parsing of the XML is somewhat different > than it would have been if they did it in a more straightforward way. > > > > > [TCPConnect host=www.ecb.europa.eu&port=80] > [text show=F]ex_rates=[TCPSend skipheader=T]GET > /stats/eurofxref/eurofxref-daily.xml > HTTP/1.0[unurl]%0D%0A%0D%0A[/unURL][/TCPSend][/text] > [/TCPConnect] > > [xmlparse var=xml_rates][ex_rates][/xmlparse] > > > [xmlNodes ref=xml_rates&path=named:gesmes:Envelope/Cube/Cube] > > [text show=F][showIf > [xmlNodeAttributes][value][/xmlNodeAttributes]^USD]USD=[middle > startAfter=&endBefore=U][xmlNodeAttributes][value][/xmlNodeAttributes][/middle][/showIf][/text] > > [text show=F][showIf > [xmlNodeAttributes][value][/xmlNodeAttributes]^AUD]AUD=[middle > startAfter=&endBefore=A][xmlNodeAttributes][value][/xmlNodeAttributes][/middle][/showIf][/text] > > [text show=F][showIf > [xmlNodeAttributes][value][/xmlNodeAttributes]^GBP]GBP=[middle > startAfter=&endBefore=G][xmlNodeAttributes][value][/xmlNodeAttributes][/middle][/showIf][/text] > > [text show=F][showIf > [xmlNodeAttributes][value][/xmlNodeAttributes]^NZD]NZD=[middle > startAfter=&endBefore=N][xmlNodeAttributes][value][/xmlNodeAttributes][/middle][/showIf][/text] > > [text show=F][showIf > [xmlNodeAttributes][value][/xmlNodeAttributes]^CAD]CAD=[middle > startAfter=&endBefore=C][xmlNodeAttributes][value][/xmlNodeAttributes][/middle][/showIf][/text] > > [/xmlNodes] > > > [text show=F]EUR=[format 0.3f][math]1.00/[USD][/math][/format][/text] > > > [writeFile /includes/EUR.inc][EUR][/writeFile] > [writeFile /includes/AUD.inc][format > 0.3f][math][AUD]*[EUR][/math][/format][/writeFile] > [writeFile /includes/GBP.inc][format > 0.3f][math][GBP]*[EUR][/math][/format][/writeFile] > [writeFile /includes/NZD.inc][format > 0.3f][math][NZD]*[EUR][/math][/format][/writeFile] > [writeFile /includes/CAD.inc][format > 0.3f][math][CAD]*[EUR][/math][/format][/writeFile] > > > > On Feb 3, 2009, at 6:58 AM, Colin Sidwell wrote: > >> Hi, >> >> On the off chance, has anyone written any code to parse this feed from >> the >> European Central Bank? >> >> http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml >> >> I want to just get the USD exchange rate out of it. >> >> I did some XML code before but it took about 2 days to get it working :-( >> >> >> Regards, >> >> Colin >> >> >> >> All services are subject to our terms & conditions, a copy of which >> can be >> found on our web site at http://www.idealinternet.co.uk/ >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> old archives: http://dev.webdna.us/TalkListArchive/ >> > > -- > Gil Poulsen, Mac Wirehead > > ************************ > AltiM@c Consulting > 23 Marco Polo Court > Franklin Park, NJ 08823-1703 > Voice: 609-359-0103 > http://altimac.com > ************************ > > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > old archives: http://dev.webdna.us/TalkListArchive/ > Colin Sidwell

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Max Record length restated as maybe bug (1997) [WebDNA] Feature requests - date format (2009) [WriteFile] problems (1997) Help! WebCat2 bug (1997) Sum of Quantities (1997) ASP and Web DNA (1998) Running _every_ page through WebCat ? (1997) Cool ShowNext (was Blasted shownext (request for 4.0)) (1998) Authentication (2001) Online reference (1997) with Link i need to (1997) attachment (2000) Searchable WebCat (etc.) Docs ? (1997) [addlineitems] display (1997) checksum for credit cards? (1997) RequiredFields template (1997) Hiding HTML and page breaks (1997) RE: [WebDNA] Installation problems for IIS 6 (2010) [BULK] [WebDNA] Are your sandbox prefs broken? (If not, are (2011) IE-caching (1998)