CSTUG

Stylesheet

<xsl:stylesheet version="1.0">

<!-- This stylesheet expands author's id into a full name. Variable $authorlist must contain the node set of the author list document. It is assigned e.g. in the index.xsl stylesheet. The stylesheet is intended to be imported into another stylesheet. -->
<xsl:key name="author" match="//c:author" use="@id"/> <xsl:template match="c:author" name="c-author"> <xsl:param name="autid"><xsl:value-of select="."/></xsl:param> <xsl:for-each select="$authorlist"> <xsl:variable name="aut" select="key('author', $autid)"/> <xsl:choose> <xsl:when test="$aut"> <xsl:choose> <xsl:when test="$aut/c:fullname"> <xsl:apply-templates select="$aut/c:fullname"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="$aut/c:firstname"/> <xsl:text/> <xsl:apply-templates select="$aut/c:surname"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <font color="red"><u><xsl:value-of select="$autid"/></u></font> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:template> <xsl:template match="c:surname|c:firstname|c:initials|c:fullname"> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet>

auth.xsl