EDN Admin
Well-known member
Hi
I have the following xml and I need to select the value of the FROM="" within the TIME attribute. How do I do that? (very new to xsl!).
<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; 201110182225<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; 201110191125<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; 201110190000<span style="color:Black; " <span style="color:Red; TO<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110200000<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, some heavy, easing evening. Gusty westerlies.<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; >17<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; >10<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; 201110200000<span style="color:Black; " <span style="color:Red; TO<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110210000<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; >Fine<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; >Fine. Fresh southwesterlies.<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; >10<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; 201110210000<span style="color:Black; " <span style="color:Red; TO<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110220000<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; >PartCloudy<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; >Fine spells. Strengthening southwesterlies.<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; >21<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; >11<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]
Once I have the value, then I should be okay in formatting it.
Thanks
View the full article
I have the following xml and I need to select the value of the FROM="" within the TIME attribute. How do I do that? (very new to xsl!).
<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; 201110182225<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; 201110191125<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; 201110190000<span style="color:Black; " <span style="color:Red; TO<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110200000<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, some heavy, easing evening. Gusty westerlies.<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; >17<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; >10<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; 201110200000<span style="color:Black; " <span style="color:Red; TO<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110210000<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; >Fine<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; >Fine. Fresh southwesterlies.<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; >10<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; 201110210000<span style="color:Black; " <span style="color:Red; TO<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 201110220000<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; >PartCloudy<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; >Fine spells. Strengthening southwesterlies.<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; >21<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; >11<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]
Once I have the value, then I should be okay in formatting it.
Thanks
View the full article