Displaying XML in HTML

TheKub

Golden Member
Oct 2, 2001
1,756
1
0
I am writing a small module for my website. This module will read an xml feed from the NOAA. Now I have decent grasp of html and I have been reading quite a bit on XML. I can easily pull up the single data entries such as temp, location, and time of reading.

What I am having trouble with is pulling the weather icon. The path to the icon is stored as 2 elements in the XML file.

<icon_url_base>http://weather.gov/weather/images/fcicons/</icon_url_base>
<icon_url_name>bkn.jpg</icon_url_name>

How do I tell the HTML of the page to combine both of these elements into a single IMG statement? Or am I approching this completely wrong?
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
What are you using to build the server page? Perl, PHP, ASP, ASP.Net, JSP, Flash?

How are you "pulling up" the XML tags now?
 

TheKub

Golden Member
Oct 2, 2001
1,756
1
0
Just HTML.


****************************************************
<xml src="PHJR.xml"id="weather">
</xml>

<table datasrc="#weather" border="1">
<tr>
<td><span datafld="temp_f"></span></td>
<td><span datafld="weather"></span></td>
<td><span datafld="icon_url_base" datafld="icon_url_name"></span><span datafld="icon_url_name"></span></td>
</tr>
</table>
********************************************************

 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Ah, I've never used XML data binding. Does this work?

< ing src=" <span > < span > " >

i.e. does IE still interpret the span tags within a src ?

If not, you may need to use either javascript (if it has XML access functions, no idea) or a real script langauge instead of DHTML.
 

TheKub

Golden Member
Oct 2, 2001
1,756
1
0
Yeah I tried combining both spans in the IMG tag and it does not work.

Guess Im off to learn some other language.

Thanks.