Subject: Re: [xsl] XHTML table of contents with XSLT From: "Daniel K. Schneider" <Daniel.Schneider@xxxxxxxxxxxxxx> Date: Sat, 24 Feb 2007 19:29:34 +0100 |
The problem below went away in Firefox when I adopted the David Carlisle and Martin Honnen solution.
Simple TOC: http://tecfa.unige.ch/guides/xml/examples/xsl-toc/xhtml-toc-ns.xsl
Numbered TOC and headers: http://tecfa.unige.ch/guides/xml/examples/xsl-toc/xhtml-toc-ns-numbered.xsl
Directory of files (also the bad stuff I made) http://tecfa.unige.ch/guides/xml/examples/xsl-toc/
Of course, they produce ugly looking output, but that would be easy to fix. Thanx very much your help, I learned something about namespaces - Daniel
(3) I then tried to number chapters. Sort of works, but then Firefox (both 1.5 on Linux and 2.0 on Win take like MINUTES (!) when files get bigger and I have
good hardware).
For once, no problem with IE 6 :) ... nor Saxon of course.
Works only with small files: http://tecfa.unige.ch/guides/xml/examples/xsl-toc/xhtml-sample-numered.xml http://tecfa.unige.ch/guides/xml/examples/xsl-toc/xhtml-toc-numbered.xsl
Is something like this bad ? (thanx for any help !!)
(the full code is in the above small xhtml-toc-numbered.xsl sample and works with small files)
<xsl:template match="*[local-name()='h2']" mode="toc"> <span style="font-size:small;"> <xsl:text>   ' </xsl:text> <xsl:number level="any" from="*[local-name()='body']" count="*[local-name()='h1']"/> <xsl:text>.</xsl:text> <xsl:number level="any" from="*[local-name()='h1']" count="*[local-name()='h2']"/> <xsl:text> </xsl:text> <a href="#h2_{generate-id(.)}"><xsl:value-of select="."/></a> </span> </xsl:template>
<xsl:template match="*[local-name()='h2']">
<h2><a name="h2_{generate-id(.)}">
<xsl:text>   ' </xsl:text>
<xsl:number level="any" from="*[local-name()='body']" count="*[local-name()='h1']"/>
<xsl:text>.</xsl:text>
<xsl:number level="any" from="*[local-name()='h1']" count="*[local-name()='h2']"/>
<xsl:text> </xsl:text>
<xsl:value-of select="."/></a> (<a href="#toc">«up</a>)</h2>
</xsl:template>
- greetings ! - Daniel
-- Dr Daniel K.Schneider, TECFA (Educational Technologies and Learning)
TECFA (TEchnologies de Formation et Apprentissage) FPSE (Faculti de Psychologie et des Sciences de l'Education) Universiti de Genhve 54 Route des Acacias, CH-1227 Carouge
email: Daniel.Schneider@xxxxxxxxxxxxxx www: http://tecfa.unige.ch/tecfa-people/schneider.html
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XHTML table of contents w, Daniel K. Schneider | Thread | [xsl] document function serving up , Steve |
Re: [xsl] XHTML table of contents w, Daniel K. Schneider | Date | Re: [xsl] document function serving, Mukul Gandhi |
Month |