From: Grant M. <gr...@us...> - 2002-04-19 20:39:55
|
Update of /cvsroot/perl-xml/perl-xml-faq In directory usw-pr-cvs1:/tmp/cvs-serv8842 Added Files: toc-links.xsl Log Message: - stylesheet for generating toc.html --- NEW FILE: toc-links.xsl --- <?xml version='1.0'?> <xsl:stylesheet version='1.0' xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="article"> <html> <head> <link rel="stylesheet" href="faq.css" type="text/css" /> <title><xsl:value-of select="./articleinfo/title" /></title> </head> <body> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="articleinfo"> <h1><xsl:value-of select="./title" /></h1> </xsl:template> <xsl:template match="qandaset"> <ol> <xsl:apply-templates/> </ol> </xsl:template> <xsl:template match="qandadiv"> <li><xsl:element name="a"> <xsl:attribute name="href">index.html#<xsl:value-of select="@id" /></xsl:attribute> <xsl:value-of select="./title" /> </xsl:element></li> <ol> <xsl:apply-templates/> </ol> </xsl:template> <xsl:template match="qandaentry"> <li><xsl:element name="a"> <xsl:attribute name="href">index.html#<xsl:value-of select="@id" /></xsl:attribute> <xsl:value-of select="./question/para" /> </xsl:element> <xsl:apply-templates/></li> </xsl:template> <xsl:template match="answer/formalpara"> <br />- <xsl:element name="a"> <xsl:attribute name="href">index.html#<xsl:value-of select="../@id" /></xsl:attribute> <xsl:value-of select="./title" /> </xsl:element> </xsl:template> <!-- <xsl:template match="section" /> --> <!-- Suppress text content for any elements not specifically matched --> <xsl:template match="text()" /> </xsl:stylesheet> |