PDA

View Full Version : Xml help....please!



rkirmeier
May 26th, 2009, 03:40 PM
Ok, I have been trying to figure out how to download weather via XML and read some of the data to control my sprinkler systems. Had this all working but then weather stopped working in G4. I tried the patch but still does not seem to work and upgrading to G5 is really not an option...

This is about as far as I have got. This will download the XML data and put it into a string but I just can't figure out how to parse/read the xml data!

local objXMLHTTP1 = luacom.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP1:Open ("GET","http://xoap.weather.com/weather/local/56301?cc=*&dayf=5&link=xoap&prod=xoap&par=1118713460&key=49be4a2b3fd69611",0)
objXMLHTTP1:Send()
local TEMPHTML = objXMLHTTP1.responseBody



If I use this line I can get the XML into a lua table but still lost....

local data = lxp.lom.parse (TEMPHTML)


Can anyone help me understand how I can read data from this xml data or lua table (converted from xml)?

One example of how to read say the temp I could probably figure out the rest...

Thanks much!
Robin

rkirmeier
May 26th, 2009, 07:34 PM
Figured out how to read the data from the specific table fields which will be good enough...