Last change
on this file was
4,
checked in by peter, 11 years ago
|
- put the recipe XML into a namespace (http://xmlns.grim.ath.cx/recipe)
- match "degrees" and turn it into a degree symbol
- added a recipe.html.xsl stylesheet that transforms recipe XML into HTML marked up with the hRecipe microformat
|
File size:
1.1 KB
|
Rev | Line | |
---|
[2] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
| 2 | |
---|
| 3 | <xsl:stylesheet version="1.0" |
---|
[4] | 4 | xmlns="http://www.w3.org/1999/xhtml" |
---|
| 5 | xmlns:recipe="http://xmlns.grim.ath.cx/recipe" |
---|
| 6 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
---|
[2] | 7 | |
---|
[4] | 8 | <xsl:template match="recipe:recipe"> |
---|
| 9 | <html> |
---|
| 10 | <head> |
---|
| 11 | <xsl:apply-templates select="title" mode="head"/> |
---|
| 12 | </head> |
---|
| 13 | <body class="hRecipe"> |
---|
| 14 | <xsl:apply-templates/> |
---|
| 15 | </body> |
---|
| 16 | </html> |
---|
| 17 | </xsl:template> |
---|
[2] | 18 | |
---|
[4] | 19 | <xsl:template match="recipe:title" mode="head"> |
---|
| 20 | <title><xsl:value-of select="."/></title> |
---|
[2] | 21 | </xsl:template> |
---|
| 22 | |
---|
[4] | 23 | <xsl:template match="recipe:title"> |
---|
| 24 | <h1 class="fn"><xsl:value-of select="."/></h1> |
---|
[2] | 25 | </xsl:template> |
---|
| 26 | |
---|
[4] | 27 | <xsl:template match="recipe:ingredients"> |
---|
| 28 | <ul> |
---|
[2] | 29 | <xsl:apply-templates/> |
---|
[4] | 30 | </ul> |
---|
[2] | 31 | </xsl:template> |
---|
| 32 | |
---|
[4] | 33 | <xsl:template match="recipe:ingredient"> |
---|
| 34 | <li class="ingredient"><xsl:value-of select="."/></li> |
---|
[2] | 35 | </xsl:template> |
---|
| 36 | |
---|
[4] | 37 | <xsl:template match="recipe:note"> |
---|
| 38 | <div style="margin-left:1em; font-size: 90%"><xsl:value-of select="."/></div> |
---|
[2] | 39 | </xsl:template> |
---|
| 40 | |
---|
[4] | 41 | <xsl:template match="recipe:para"> |
---|
| 42 | <p> |
---|
[2] | 43 | <xsl:value-of select="."/> |
---|
[4] | 44 | </p> |
---|
[2] | 45 | </xsl:template> |
---|
| 46 | |
---|
| 47 | </xsl:stylesheet> |
---|
Note: See
TracBrowser
for help on using the repository browser.