Connecting Tech Pros Worldwide Forums | Help | Site Map

url redirects from xsl style sheet

Newbie
 
Join Date: Aug 2006
Posts: 5
#1: Aug 12 '06
I have a personal web server that imports from my weather station. The data is already in XML format. I created my xsl and it displays the data on the web page very nicely.

I have been unsuccessful on trying to link from the discriptor field. I'm trying to link to a more detailled report on each item to show a graph of the past 12 hours. I have the part done and this part. I need help breaking my roadblock to link the discriptor to the individual html page with the graph on that item.

ie.. wind speed showes the current data i\on the web page. I want to click on wind speed ( descriptor in the XSL ) to bbring up the next web page to display the wind graph data for the past 12 or 24 hours.

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <xsl:stylesheet version="1.0"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/">
  4.   <html>
  5.   <body bgcolor="#999999">
  6.     <table border="1">
  7.       <tr bgcolor="#9acd32">
  8.         <th align="left">Date stamp</th> 
  9.         <th align="left">Time stamp</th> 
  10.         <th align="left">Outdoor Temp</th> 
  11.         <th align="left">Humidity </th> 
  12.         <th align="left">Bar Pressure Mb</th> 
  13.         <th align="left">Wind Speed</th> 
  14.         <th align="left">wind Dir</th> 
  15.         <th align="left">Angle</th> 
  16.       </tr>
  17.       <xsl:for-each select="/">
  18.       <tr>
  19.         <td bgcolor="#ccffcc"><xsl:value-of select="/ws2300/Date" /></td>
  20.         <td bgcolor="#ccffcc"><xsl:value-of select="/ws2300/Time" /></td>
  21.         <td bgcolor="#ccffcc"><xsl:value-of select="/ws2300/Temperature/Outdoor/Value" /></td>
  22.         <td bgcolor="#ccffcc"><xsl:value-of select="/ws2300/Humidity/Outdoor/Value" /></td>
  23.         <td bgcolor="#ccffcc"><xsl:value-of select="/ws2300/Pressure/Value" /></td>
  24.         <td bgcolor="#ccffcc"><xsl:value-of select="/ws2300/Wind/Value" /></td>
  25.         <td bgcolor="#ccffcc"><xsl:value-of select="/ws2300/Wind/Direction/Text" /></td>
  26.         <td bgcolor="#ccffcc"><xsl:value-of select="/ws2300/Wind/Direction/Dir0" /></td>
  27.       </tr>
  28.       </xsl:for-each>
  29.   </table>
  30.   </body>
  31.   </html>
  32. </xsl:template></xsl:stylesheet>

Newbie
 
Join Date: Aug 2006
Posts: 5
#2: Aug 12 '06

re: url redirects from xsl style sheet


Date stamp Time stamp Outdoor Temp Humidity Bar Pressure Mb Wind Speed wind Dir Angle
2006-08-12 15:08:34 88.7 19 1013.500 0.0 SE 135.0




xml data that is used


<?xml version="1.0" encoding="utf-8"?>
<ws2300 version="1.0">
<Date>2006-08-12</Date>
<Time>15:08:34</Time>
<Temperature>
<Indoor>
<Value>75.2</Value>
<Min>68.0</Min>
<Max>87.6</Max>
<MinTime>09:32</MinTime>
<MinDate>2006-06-13</MinDate>
<MaxTime>20:36</MaxTime>
<MaxDate>2006-05-30</MaxDate>
</Indoor>
<Outdoor>
<Value>88.7</Value>
<Min>50.2</Min>
<Max>106.5</Max>
<MinTime>06:15</MinTime>
<MinDate>2006-06-11</MinDate>
<MaxTime>11:35</MaxTime>
<MaxDate>2006-08-03</MaxDate>
</Outdoor>
</Temperature>
<Humidity>
<Indoor>
<Value>53</Value>
<Min>41</Min>
<Max>69</Max>
<MinTime>19:43</MinTime>
<MinDate>2006-06-11</MinDate>
<MaxTime>12:54</MaxTime>
<MaxDate>2006-07-23</MaxDate>
</Indoor>
<Outdoor>
<Value>19</Value>
<Min>11</Min>
<Max>96</Max>
<MinTime>18:29</MinTime>
<MinDate>2006-05-29</MinDate>
<MaxTime>06:51</MaxTime>
<MaxDate>2006-08-12</MaxDate>
</Outdoor>
</Humidity>
<Dewpoint>
<Value>278.0</Value>
<Min>29.1</Min>
<Max>79.2</Max>
<MinTime>10:27</MinTime>
<MinDate>2006-06-11</MinDate>
<MaxTime>07:34</MaxTime>
<MaxDate>2006-08-03</MaxDate>
</Dewpoint>
<Wind>
<Value>0.0</Value>
<Direction>
<Text>SE</Text>
<Dir0>135.0</Dir0>
<Dir1>112.5</Dir1>
<Dir2>135.0</Dir2>
<Dir3>112.5</Dir3>
<Dir4>0.0</Dir4>
<Dir5>0.0</Dir5>
</Direction>
<Min>0.0</Min>
<Max>29.5</Max>
<MinTime>15:10</MinTime>
<MinDate>2006-08-12</MinDate>
<MaxTime>20:12</MaxTime>
<MaxDate>2006-06-04</MaxDate>
</Wind>
<Windchill>
<Value>88.7</Value>
<Min>47.3</Min>
<Max>106.5</Max>
<MinTime>04:04</MinTime>
<MinDate>2006-06-05</MinDate>
<MaxTime>11:35</MaxTime>
<MaxDate>2006-08-03</MaxDate>
</Windchill>
<Rain>
<OneHour>
<Value>0.00</Value>
<Max>0.02</Max>
<MaxTime>18:40</MaxTime>
<MaxDate>2006-07-21</MaxDate>
</OneHour>
<TwentyFourHour>
<Value>0.00</Value>
<Max>0.02</Max>
<MaxTime>16:57</MaxTime>
<MaxDate>2006-07-22</MaxDate>
</TwentyFourHour>
<Total>
<Value>0.02</Value>
<Time>11:12</Time>
<Date>2006-06-03</Date>
</Total>
</Rain>
<Pressure>
<Value>1013.500</Value>
<Min>1001.600</Min>
<Max>1021.300</Max>
<MinTime>05:41</MinTime>
<MinDate>2006-06-03</MinDate>
<MaxTime>10:28</MaxTime>
<MaxDate>2006-07-07</MaxDate>
<Tendency>Rising</Tendency>
</Pressure>
<Forecast>Sunny</Forecast>
</ws2300>
Reply