dacarver | bdfd59d | 2008-10-17 22:41:14 +0000 | [diff] [blame^] | 1 | <!-- |
| 2 | |
| 3 | Stylesheet for creating the file html/toc.html based on tocconcepts.xml |
| 4 | and toctasks.xml. |
| 5 | |
| 6 | --> |
| 7 | <xsl:stylesheet version="1.0" |
| 8 | xmlns="http://www.w3.org/1999/xhtml" |
| 9 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| 10 | |
| 11 | |
| 12 | <xsl:template match="/"> |
| 13 | <html> |
| 14 | <head> |
| 15 | <title>Vex User Guide</title> |
| 16 | </head> |
| 17 | <body> |
| 18 | |
| 19 | <xsl:apply-templates/> |
| 20 | |
| 21 | </body> |
| 22 | </html> |
| 23 | </xsl:template> |
| 24 | |
| 25 | <xsl:template match="toc" name="toc"> |
| 26 | <xsl:param name="hlevel" select="1"/> |
| 27 | <xsl:element name="h{$hlevel}"> |
| 28 | <xsl:value-of select="@label"/> |
| 29 | </xsl:element> |
| 30 | <xsl:apply-templates/> |
| 31 | </xsl:template> |
| 32 | |
| 33 | <xsl:template match="topic[anchor]"> |
| 34 | <xsl:for-each select="document(concat('toc', anchor/@id, '.xml'))/toc"> |
| 35 | <xsl:call-template name="toc"> |
| 36 | <xsl:with-param name="hlevel" select="2"/> |
| 37 | </xsl:call-template> |
| 38 | </xsl:for-each> |
| 39 | </xsl:template> |
| 40 | |
| 41 | <xsl:template match="topic[topic]"> |
| 42 | <li><a href="{@href}"><xsl:value-of select="@label"/></a></li> |
| 43 | <ul> |
| 44 | <xsl:apply-templates/> |
| 45 | </ul> |
| 46 | </xsl:template> |
| 47 | |
| 48 | <xsl:template match="topic"> |
| 49 | <li><a href="{@href}"><xsl:value-of select="@label"/></a></li> |
| 50 | </xsl:template> |
| 51 | |
| 52 | </xsl:stylesheet> |