Jump to content

Cannot generate html table via xslt


thatsme

Recommended Posts

Hi, this is a piece of my transf.xslt document. Unfortunately, second template does not create table. It correctly reads values from xml file but displays them in the single line in the result file instead of putting them into table. Could anyone of you tell what is wrong?

	<xsl:template match="/">		<html xmlns="http://www.w3.org/1999/xhtml">		<body style="background-color: #B4EEB4">		<xsl:for-each select="Countries/DescribedCountryArmy">			<xsl:sort select="Name"/>			<h1 style="font-family: verdana; font-size: 16pt; color: #8B7E66">				<xsl:number format="1. " value="position()"/>				<xsl:value-of select="Name"/>			</h1>			<p style="font-family: verdana; font-size: 12pt">				Yearly military expenses: <xsl:value-of select="MilitaryExpensesFromGDP"/>%;				<br/>				Comander of the army: <xsl:value-of select="Commander"/>;								<xsl:apply-templates select="LandForces"/>									<xsl:apply-templates select="AirForces"/>				<xsl:apply-templates select="Navy"/>			</p>		</xsl:for-each>		</body>		</html>	</xsl:template>	<xsl:template match="LandForces">		<table border="1" style="background-color:#9BCD9B">			<tr>				<td> <xsl:value-of select="local-name()"/> </td>				<td> fgbfgv</td>			</tr>			<tr>				<td>Date of foundation</td>				<td> <xsl:value-of select="FoundationDate"/> </td>			</tr>			<tr>				<td>Count of military personnel</td>		 		<td> <xsl:value-of select="MilitaryPersonnel"/> </td>			</tr>			<tr>				<td>Count of tanks</td>		 		<td> <xsl:value-of select="Tanks"/> </td>			</tr>		</table>	</xsl:template>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...