Extract xml Data

Hi there,

I’m following the Corona XML tutorial (http://coronalabs.com/blog/2011/07/29/how-to-use-xml-files-in-corona/), and have also previously with succes extracted xml data using this tutorial.

But now I’v hit a block with getting data from an external api - so I’m posting the xml data here, hoping that someone can point me in the right direction. I need to get the data stored in the tabular Tag.

\<weatherdata\> \<location\>...\</location\> \<credit\>...\</credit\> \<links\>...\</links\> \<meta\>...\</meta\> \<sun&nbsp;rise="2015-02-25T07:22:37"&nbsp;set="2015-02-25T17:46:30"/\> \<forecast\> \<tabular\> \<time&nbsp;from="2015-02-25T13:00:00"&nbsp;to="2015-02-25T14:00:00"\> \<!-- Valid from 2015-02-25T13:00:00 to 2015-02-25T14:00:00 --\> \<symbol&nbsp;number="5"&nbsp;numberEx="40"&nbsp;name="Lette regnbyger"&nbsp;var="40d"/\> \<precipitation&nbsp;value="0.1"&nbsp;minvalue="0"&nbsp;maxvalue="1.0"/\> \<!-- Valid at 2015-02-25T13:00:00 --\> \<windDirection&nbsp;deg="224.3"&nbsp;code="SW"&nbsp;name="Sørvest"/\> \<windSpeed&nbsp;mps="4.7"&nbsp;name="Lett bris"/\> \<temperature&nbsp;unit="celsius"&nbsp;value="6"/\> \<pressure&nbsp;unit="hPa"&nbsp;value="1012.3"/\> \</time\>

I need to get the data stored in the tabular Tag - any help would be greatly appriciated.

Best Wishes

/Thomas

My recommendation is that you use a table printing function to print the table out so you can see what the path to your entry is. 

http://coronalabs.com/blog/2014/09/02/tutorial-printing-table-contents/

It will be something like: child[0].child[0] or something like that.

Rob

Hey Rob,

Thank you very much . that did the trick :smiley:

Best Wishes

/Thomas

My recommendation is that you use a table printing function to print the table out so you can see what the path to your entry is. 

http://coronalabs.com/blog/2014/09/02/tutorial-printing-table-contents/

It will be something like: child[0].child[0] or something like that.

Rob

Hey Rob,

Thank you very much . that did the trick :smiley:

Best Wishes

/Thomas