?
=?iso-8859-1?q?Tobias_M=FCller?=
Hello everybody,
I've got some weather data from my local wx station and want to display
this as a short table by using a XSL template. The data looks like
<?xml version="1.0"?>
<weather-data>
<station name="external temp." sensor="3" type="temperature"
unit="°C">
<datum date="04.09.2005" time="12:00" value="10" />
<datum date="04.09.2005" time="13:00" value="12" />
<datum date="04.09.2005" time="14:00" value="14" />
<datum date="04.09.2005" time="15:00" value="13.2" />
<datum date="04.09.2005" time="16:00" value="11.3" />
<datum date="04.09.2005" time="17:00" value="9.8" />
<datum date="04.09.2005" time="18:00" value="8.6" />
<datum date="04.09.2005" time="19:00" value="6.4" />
<datum date="04.09.2005" time="20:00" value="4" />
</station>
<station name="air pressure" sensor="3" type="pressure"
unit="mBar">
<datum date="04.09.2005" time="12:00" value="1020" />
<datum date="04.09.2005" time="12:30" value="1020" />
<datum date="04.09.2005" time="13:00" value="1021" />
<datum date="04.09.2005" time="13:30" value="1021" />
<datum date="04.09.2005" time="14:00" value="1022" />
<datum date="04.09.2005" time="15:00" value="1022" />
<datum date="04.09.2005" time="16:00" value="1023" />
<datum date="04.09.2005" time="17:00" value="1024" />
<datum date="04.09.2005" time="18:00" value="1025" />
<datum date="04.09.2005" time="19:00" value="1025" />
<datum date="04.09.2005" time="20:00" value="1025" />
</station>
</weather-data>
and should be converted in a table like
<table border="1">
<tr>
<th>date</th>
<th>time</th>
<th>external temp.</th>
<th>air pressure</th>
</tr>
<tr>
<td>04.09.2005</td>
<td>12:00</td>
<td>10</td>
<td>1020</td>
</tr>
<tr>
<td>04.09.2005</td>
<td>12:30</td>
<td></td>
<td>1020</td>
</tr>
<tr>
<td>04.09.2005</td>
<td>13:00</td>
<td>12</td>
<td>1021</td>
</tr>
...
</table>
And don't have any ideas to achieve this. I just got 2 seperate tables
using a for-each template, but I think this won't work here. Any ideas?
If there's no solution I could consider changing the way the XML file
looks like, but this way it's very easy to generate it.
Regards
Tobias
I've got some weather data from my local wx station and want to display
this as a short table by using a XSL template. The data looks like
<?xml version="1.0"?>
<weather-data>
<station name="external temp." sensor="3" type="temperature"
unit="°C">
<datum date="04.09.2005" time="12:00" value="10" />
<datum date="04.09.2005" time="13:00" value="12" />
<datum date="04.09.2005" time="14:00" value="14" />
<datum date="04.09.2005" time="15:00" value="13.2" />
<datum date="04.09.2005" time="16:00" value="11.3" />
<datum date="04.09.2005" time="17:00" value="9.8" />
<datum date="04.09.2005" time="18:00" value="8.6" />
<datum date="04.09.2005" time="19:00" value="6.4" />
<datum date="04.09.2005" time="20:00" value="4" />
</station>
<station name="air pressure" sensor="3" type="pressure"
unit="mBar">
<datum date="04.09.2005" time="12:00" value="1020" />
<datum date="04.09.2005" time="12:30" value="1020" />
<datum date="04.09.2005" time="13:00" value="1021" />
<datum date="04.09.2005" time="13:30" value="1021" />
<datum date="04.09.2005" time="14:00" value="1022" />
<datum date="04.09.2005" time="15:00" value="1022" />
<datum date="04.09.2005" time="16:00" value="1023" />
<datum date="04.09.2005" time="17:00" value="1024" />
<datum date="04.09.2005" time="18:00" value="1025" />
<datum date="04.09.2005" time="19:00" value="1025" />
<datum date="04.09.2005" time="20:00" value="1025" />
</station>
</weather-data>
and should be converted in a table like
<table border="1">
<tr>
<th>date</th>
<th>time</th>
<th>external temp.</th>
<th>air pressure</th>
</tr>
<tr>
<td>04.09.2005</td>
<td>12:00</td>
<td>10</td>
<td>1020</td>
</tr>
<tr>
<td>04.09.2005</td>
<td>12:30</td>
<td></td>
<td>1020</td>
</tr>
<tr>
<td>04.09.2005</td>
<td>13:00</td>
<td>12</td>
<td>1021</td>
</tr>
...
</table>
And don't have any ideas to achieve this. I just got 2 seperate tables
using a for-each template, but I think this won't work here. Any ideas?
If there's no solution I could consider changing the way the XML file
looks like, but this way it's very easy to generate it.
Regards
Tobias