OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: help with xslt

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"/>
    <a class="{@role}" href="{$clhs.body}{@url}.html"><xsl:apply-templates/></a>

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 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.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]