Re: [WebDNA] XML Help please

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 101911
interpreted = N
texte = 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 ************************ 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)
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 ************************ Gil Poulsen

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:

wierd [cart] action! (1997) Another question about credit cards (1997) WebCat2 Append problem (B14Macacgi) (1997) Templates on Unix & CGI on Mac? (1997) Searchable WebCat (etc.) Docs ? (1997) CSS positioning!!! (2001) Help! WebCat2 bug (1997) Forcing price recalculation in shopping cart (1998) Saturday [encrypt] blues.... (2000) [WebDNA] Abandoned Carts (2009) Cookies Question (2000) MOOOOOO (2000) RE: Answer: WebDelivery downloads alias, not original ? (1997) [numfound] within summ=t ??? (2000) emailer on Windows Beta 18 (1997) RE: type 2 errors with ssl server (1997) Navigator Parsing (1997) SFTP [scp solution] (2004) 4.0.x find (2000) DB Field Name? (2000)