Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Creating a table within a XSL-stylesheet

From: tMan@-----------.---------.---
To: NULL
Date: 12/2/2004 10:27:00 AM
can you post your xml?

"Tessie  Sweden" wrote:

> Hi!
> 
> A table is supposed to be created inside the <body>-tags, correct?
> Mine is displayed, but all of it's contents ends up OUTSIDE the table:
> 
> http://www.student.nada.kth.se/~u1j80hrt/2D1517/XMLprojekt/recept.php
> 
> I think it is a problem with "<xsl:apply-templates
> select="ingredients"/>" on line 15. I don't know where to put it
> really :)If I remove that line, everything goes away!
> 
> This is my XSL-stylesheet:
> ******************************************************************
> <xsl:template match="cookbook"> 
>  <html>
>   <head>
> 	<title>	 
> 		<xsl:apply-templates select="title"/>
> 	</title>
>   </head>
> 	  <body>
>   		<h1>Recipe:</h1>
> 		<ul>
> 	  <xsl:apply-templates select="recipe"/>
> 		</ul>
> 		<h1>Ingredients:</h1>
> 	
>   <xsl:apply-templates select="ingredients"/>
> 	  
>       <table border="1">
>          <tr bgcolor="#ffffff">
>          <th>Amount</th>
>          <th>Unit</th>
>          <th>Ingredient</th>
>          </tr>
>        <xsl:for-each select="ingredients/recipe_id">	
>         <tr>
> 		 <td><xsl:value-of select="amount"/></td>
>          <td><xsl:value-of select="unit"/></td>
>          <td><xsl:value-of select="ingredient"/></td>
>         </tr>
>        </xsl:for-each>
>       </table>
> 	 </body>  
> 	</html>
>  </xsl:template>
> 
>     <xsl:template match="recipe">
> 		<li>
>              <xsl:apply-templates select="recipe_name"/>
> 			 <xsl:text>. </xsl:text>
>              <xsl:apply-templates select="type"/>
> 			 <xsl:text>. </xsl:text>
>              <xsl:apply-templates select="chef"/>
> 			 <xsl:text>. </xsl:text>
>              <xsl:apply-templates select="description"/>
> 		</li>
> 	</xsl:template>
> 
>    <xsl:template match="cookbook/ingredients/amount">			
> 				<xsl:apply-templates />
> 				</xsl:template>
> 
>    <xsl:template match="cookbook/ingredients/unit">			
> 				<xsl:apply-templates />			
> 				</xsl:template>
> 
>    <xsl:template match="cookbook/ingredients/ingredient">			
> 				<xsl:apply-templates />
> 				</xsl:template>
> 
> </xsl:stylesheet>
> *********************************************************************
> 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent