xsl-list
[Top] [All Lists]

[xsl] Tieing elements and corresponding child elements together.

2007-10-31 21:56:29
Hello, the XML below is a sharply simplified version of Memphis weather data available from the National Weather Service's SOAP web service[1].

<dwml version="1.0">
 <data>
   <time-layout time-coordinate="local" summarization="none">
     <layout-key>k-p24h-n7-1</layout-key>
     <start-valid-time period-name="Tomorrow"/>   <!-- Thursday -->
     <start-valid-time period-name="Friday"/>
     <start-valid-time period-name="Saturday"/>
     <start-valid-time period-name="Sunday"/>
     <start-valid-time period-name="Monday"/>
     <start-valid-time period-name="Tuesday"/>
     <start-valid-time period-name="Wednesday"/>
   </time-layout>
   <time-layout time-coordinate="local" summarization="none">
     <layout-key>k-p24h-n7-2</layout-key>
     <start-valid-time period-name="Tonight"/>   <--- Wed. night -->
     <start-valid-time period-name="Tomorrow Night/>
     <start-valid-time period-name="Friday Night"/>
     <start-valid-time period-name="Saturday Night"/>
     <start-valid-time period-name="Sunday Night"/>
     <start-valid-time period-name="Monday Night"/>
     <start-valid-time period-name="Tuesday Night"/>
   </time-layout>
   <parameters applicable-location="point1">
<temperature type="maximum" units="Fahrenheit" time-layout="k-p24h-n7-1">
       <name>Daily Maximum Temperature</name>
       <value>65</value>
       <value>66</value>
       <value>68</value>
       <value>71</value>
       <value>72</value>
       <value>63</value>
       <value>60</value>
     </temperature>
<temperature type="minimum" units="Fahrenheit" time-layout="k-p24h-n7-2">
       <name>Daily Minimum Temperature</name>
       <value>55</value>
       <value>44</value>
       <value>44</value>
       <value>46</value>
       <value>50</value>
       <value>49</value>
       <value>41</value>
     </temperature>
    </parameters>
 </data>
</dwml>


With this data, I would like to create a simple listing as follows:

Daily Maximum Temperatures:
-----------------------
Tomorrow: 65 Friday: 66
Saturday: 68
...

Daily Minimum Temperatures:
------------------------
Tonight: 55 Tomorrow Night: 44
Friday Night: 44
...

Note that, in the XML data, the blocks of time-layouts are tied to the Max. and Min. temps below via the layout-key element / time-layout attribute combination.
I guess my questions are
(1) how can I tie the time-layout elements and temperature elements together using XSLT 1.0 using the layout-key
and
(2) how can I tie each period-name to its corresponding position with the temperatures that it is associated with

In other words, how can I create my table above?

Thanks,
Glen

[1] http://www.weather.gov/xml/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Tieing elements and corresponding child elements together., Glen Mazza <=