|
Subject: Re: [xsl] XHTML table of contents with XSLT From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Sat, 24 Feb 2007 17:46:34 +0100 |
(2) David Carlisle told me to replace the ugly "*[local-name()='xxx']" by "h:xxx"
but then I run into namespace problems (this why I put them there in the first place).
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="h"><xsl:template match="/h:html">
<html>
<head>
<title><xsl:value-of select="h:title"/></title>
</head> <body bgcolor="#FFFFFF">
<xsl:apply-templates select="h:body"/>
</body>
</html>
</xsl:template><xsl:template match="h:body"> <strong><a name="toc">Contents</a></strong> <xsl:apply-templates select="h:h1 | h:h2" mode="toc"/> <xsl:apply-templates />
<xsl:template match="h:h1" mode="toc">
<br/>
<a href="#h1_{generate-id(.)}"><xsl:value-of select="."/></a><br/>
</xsl:template>Martin Honnen http://JavaScript.FAQTs.com/
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] XHTML table of contents w, Daniel K. Schneider | Thread | Re: [xsl] XHTML table of contents w, Daniel K. Schneider |
| Re: [xsl] XHTML table of contents w, Daniel K. Schneider | Date | Re: [xsl] XHTML table of contents w, Daniel K. Schneider |
| Month |