Hi all,
I'm having problem with my xsl project.I want to display all the
xml data in a table using xsl.
My problem is why all my table display the same data(only the first data displayed and being repeated in other table).it seems that the program does not iterate even if i'm using for each.Can somebody help me????
XML file contains:
<tpeg_document generation_time="2006-11-28T02:44:56+0" >
<tpeg_message >
<originator country="UK" originator_name="BBC Travel News" />
<summary lang="en" > A8014 West Dunbartonshire - Traffic light failure on Kilbowie Road both ways at the A82 Great Western Road junction.
</summary>
.....
.....
.....
</tpeg_message>
<tpeg_message>.........</tpeg_message>
My XSL file:
<xsl:template match="tpeg_document" >
<xsl:apply-templates />
</xsl:template>
<xsl:template match="tpeg_message" >
<table border="1">
<xsl:for-each select="." >
<th colspan="2">Traffic Incidents</th>
<tr>
<td><b>Time of Incidents</b></td>
<td><xsl:value-of select="//@message_generation_time" /></td>
</tr>
<tr>
<td><b>Severity Factor</b></td>
<td><xsl:value-of select="//@severity_factor" /></td>
</tr>
<tr>
<td><b>Latitude</b></td>
<td><xsl:value-of select="//@latitude" /></td>
</tr>
<tr>
<td><b>Longitude</b></td>
<td><xsl:value-of select="//@longitude" /></td>
</tr>
<tr>
<td><b>Summary</b></td>
<td><xsl:value-of select="//summary" /></td></tr>
</xsl:for-each>
</table>
</xsl:template>