Help with XSL and choosing an image to display

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi
I am very new to using XSL to display XML. I have received the following XML code and I need to display this within a webpage exactly like the image but I have no clue how to do this.
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; XMETL <span style="color:Red; TIMEZONE<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; LOCAL<span style="color:Black; " <span style="color:Red; ISSUED<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110100101<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; COUNTRY <span style="color:Red; NAME<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; NZ<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DATA <span style="color:Red; TYPE<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; FORECAST<span style="color:Black; " <span style="color:Red; ISSUED<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110101401<span style="color:Black; " <span style="color:Red; STATUS<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ROUTINE<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; TIME <span style="color:Red; FROM<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110100000<span style="color:Black; " <span style="color:Red; TO<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110110000<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; LOCATION <span style="color:Red; ID<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Whangarei<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; forecastword<span style="color:Blue; >Rain<span style="color:Blue; </<span style="color:#A31515; forecastword<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; forecast<span style="color:Blue; >Rain,heavy falls,strong northeast.All easing evening.<span style="color:Blue; </<span style="color:#A31515; forecast<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Max<span style="color:Blue; >18<span style="color:Blue; </<span style="color:#A31515; Max<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Min<span style="color:Blue; >14<span style="color:Blue; </<span style="color:#A31515; Min<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; LOCATION<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; TIME<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; TIME <span style="color:Red; FROM<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110110000<span style="color:Black; " <span style="color:Red; TO<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110120000<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; LOCATION <span style="color:Red; ID<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Whangarei<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; forecastword<span style="color:Blue; >Showers<span style="color:Blue; </<span style="color:#A31515; forecastword<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; forecast<span style="color:Blue; >Showers at first rain later. Northerlies freshening.<span style="color:Blue; </<span style="color:#A31515; forecast<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Max<span style="color:Blue; >20<span style="color:Blue; </<span style="color:#A31515; Max<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Min<span style="color:Blue; >15<span style="color:Blue; </<span style="color:#A31515; Min<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; LOCATION<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; TIME<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; TIME <span style="color:Red; FROM<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110120000<span style="color:Black; " <span style="color:Red; TO<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110130000<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; LOCATION <span style="color:Red; ID<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Whangarei<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; forecastword<span style="color:Blue; >Rain<span style="color:Blue; </<span style="color:#A31515; forecastword<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; forecast<span style="color:Blue; >Rain, easing later. Northerly changing westerly.<span style="color:Blue; </<span style="color:#A31515; forecast<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Max<span style="color:Blue; >19<span style="color:Blue; </<span style="color:#A31515; Max<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Min<span style="color:Blue; >13<span style="color:Blue; </<span style="color:#A31515; Min<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; LOCATION<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; TIME<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; DATA<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; COUNTRY<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; XMETL<span style="color:Blue; >
[/code]
This is how it should display:
<img src="http://social.microsoft.com/Forums/getfile/21898/" alt="
I need to display different images (like a cloud, sun or rain image) depending on what <forecastword> is used.
I also only need to display two days but the XML lists three days.
Any help would be appreciated. Thanks.
PS. Anybody know where I can learn XSL?

View the full article
 
Back
Top