[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: help with xslt
Hi,
I maintain clisp (http://clisp.cons.org), in particular, the clisp manual
("implementation notes") in DocBook/xml format.
the manual has a lot of links to the CLHS (Common Lisp HyperSpec, the HTML
version of the ANSI standard).
I keep them in the form
<ulink role="clhs" url="sec_11-1-2-1-2"/>
which is converted by
<xsl:param name="clhs.top" select="'http://www.lisp.org/HyperSpec/'"/>
<xsl:param name="clhs.body" select="concat($clhs.top, 'Body/')"/>
<xsl:template match="ulink[@role='clhs']">
<xsl:choose><xsl:when test=".=''">
<a class="{@role}" href="{$clhs.body}{@url}.html"><xsl:text>[</xsl:text>
<xsl:value-of select="@url"/>
<xsl:text>]</xsl:text></a></xsl:when>
<xsl:otherwise>
<a class="{@role}" href="{$clhs.body}{@url}.html"><xsl:apply-templates/></a>
</xsl:otherwise></xsl:choose></xsl:template>
alas, there are two versions of CLHS around, the older one (for which the above
is geared) and the newer one, with a different page naming system.
specifically, section 11.1.2.1.2 which is sec_11-1-2-1-2.html is the older
version is now 11_abab.html while chap-11.html is now 11_.html.
I want to be able to generate clisp impnotes which link to either version based
on a variable setting at processing time.
This would mean that I would have to write an xslt function mapping an array of
integers #(11 1 2 1 2) to either sec_11-1-2-1-2 or 11_abab.
How do I do that?
To begin with, I don't even know how to iterate (or recurse) in xslt.
I use xsltproc on linux.
Thanks
Sam
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]