View Single Post
Old 07-19-2019, 01:18 PM   #1
duke217
Newly Registered User
 
Join Date: Jan 2018
Location: Bratislava, SR
Posts: 13
Thanks: 8
Thanked 1 Time in 1 Post
duke217 is on a distinguished road
displaying data from an xml file on a form

Hi all,

I am trying to display data from an xml file that I can get from the web.

Here's how it works:

If I call this URL in a browser:
Code:
https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&hoursBeforeNow=3&mostRecent=true&stationString=EGLL
the website returns an XML page that looks like ths:

Code:
<response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XML-Schema-instance" version="1.2" xsi:noNamespaceSchemaLocation="http://aviationweather.gov/adds/schema/metar1_2.xsd">
<request_index>36589223</request_index>
<data_source name="metars"/>
<request type="retrieve"/>
<errors/>
<warnings/>
<time_taken_ms>6</time_taken_ms>
<data num_results="1">
<METAR>
<raw_text>
EGLL 192050Z AUTO 21009KT 9999 -RA FEW011 BKN018 BKN024 18/17 Q1009 TEMPO RA BKN009
</raw_text>
<station_id>EGLL</station_id>
<observation_time>2019-07-19T20:50:00Z</observation_time>
<latitude>51.48</latitude>
<longitude>-0.45</longitude>
<temp_c>18.0</temp_c>
<dewpoint_c>17.0</dewpoint_c>
<wind_dir_degrees>210</wind_dir_degrees>
<wind_speed_kt>9</wind_speed_kt>
<visibility_statute_mi>6.21</visibility_statute_mi>
<altim_in_hg>29.793306</altim_in_hg>
<quality_control_flags>
<auto>TRUE</auto>
</quality_control_flags>
<wx_string>-RA</wx_string>
<sky_condition sky_cover="FEW" cloud_base_ft_agl="1100"/>
<sky_condition sky_cover="BKN" cloud_base_ft_agl="1800"/>
<sky_condition sky_cover="BKN" cloud_base_ft_agl="2400"/>
<flight_category>MVFR</flight_category>
<metar_type>METAR</metar_type>
<elevation_m>24.0</elevation_m>
</METAR>
</data>
</response>
Now, what I have been trying to achieve for quite some time is to display the text between the <raw_text> and </raw_text> tags to be displayed on my form.

Any idea how to do that?

duke217 is offline   Reply With Quote