Support alt attribute for libraryname element

[SVN r20776]
This commit is contained in:
Douglas Gregor 2003-11-10 16:04:28 +00:00
parent 075fcc3cbd
commit 6dacc29300
2 changed files with 16 additions and 4 deletions

View File

@ -137,19 +137,30 @@
</xsl:template>
<xsl:template match="libraryname" mode="annotation">
<xsl:variable name="name" select="text()"/>
<xsl:variable name="name">
<xsl:when test="@alt">
<xsl:value-of select="@alt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="text()"/>
</xsl:otherwise>
</xsl:variable>
<xsl:variable name="node" select="key('libraries', $name)"/>
<xsl:choose>
<xsl:when test="count($node)=0">
<xsl:message>
Cannot find library '<xsl:value-of select="$name"/>'
<xsl:text>warning: Cannot find library '</xsl:text>
<xsl:value-of select="$name"/>
<xsl:text>'</xsl:text>
</xsl:message>
<xsl:value-of select="$name"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="library.link">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="name" select="text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>

View File

@ -15,6 +15,7 @@
<xsl:template name="library.link">
<xsl:param name="node" select="."/>
<xsl:param name="name" select="$node/attribute::name"/>
<xsl:choose>
<xsl:when test="$node/attribute::html-only = 1">
@ -34,7 +35,7 @@
<xsl:attribute name="url">
<xsl:value-of select="$url"/>
</xsl:attribute>
<xsl:value-of select="$node/attribute::name"/>
<xsl:value-of select="$name"/>
</ulink>
</xsl:when>
<xsl:otherwise>
@ -51,7 +52,7 @@
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="text" select="string($node/attribute::name)"/>
<xsl:with-param name="text" select="$name"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>