New feature: show URL descriptions, not just links.
Bug fix: trim whitespace from sponsor names. Approved by: doceng (implicit)
This commit is contained in:
parent
711364072c
commit
4788a7cd10
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=47005
1 changed files with 24 additions and 11 deletions
|
@ -110,7 +110,7 @@
|
||||||
<xsl:if test="sponsor">
|
<xsl:if test="sponsor">
|
||||||
<xsl:variable name="sponsors">
|
<xsl:variable name="sponsors">
|
||||||
<xsl:for-each select="sponsor">
|
<xsl:for-each select="sponsor">
|
||||||
<xsl:value-of select="."/>
|
<xsl:value-of select="normalize-space()"/>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="position() = last()">.</xsl:when>
|
<xsl:when test="position() = last()">.</xsl:when>
|
||||||
<xsl:when test="position() = (last() - 1)">, and </xsl:when>
|
<xsl:when test="position() = (last() - 1)">, and </xsl:when>
|
||||||
|
@ -141,19 +141,32 @@
|
||||||
</p>
|
</p>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Create a paragraph to hold the link information. Iterate over each
|
<!-- Create a table to hold the link information. Iterate over each
|
||||||
<url> element, copying their data in. All but the last link has a
|
<url> element, adding a row to hold the description and URL.
|
||||||
terminating <br> in the output. -->
|
Both work as links. -->
|
||||||
<xsl:template match="links">
|
<xsl:template match="links">
|
||||||
<p>
|
<table title="Links">
|
||||||
|
<tr>
|
||||||
|
<td>Links</td>
|
||||||
|
</tr>
|
||||||
<xsl:for-each select="url">
|
<xsl:for-each select="url">
|
||||||
URL:
|
<tr>
|
||||||
<a href="{@href}" title="{.}"> <!-- Copy in the href attribute -->
|
<td>
|
||||||
<xsl:value-of select="@href"/>
|
<a href="{@href}" title="{@href}">
|
||||||
</a>
|
<xsl:value-of select="normalize-space()"/>
|
||||||
<xsl:if test="position() != last()"><br/></xsl:if>
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
URL: <a href="{@href}">
|
||||||
|
<xsl:attribute name="title">
|
||||||
|
<xsl:value-of select="normalize-space()"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:value-of select="@href"/>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</p>
|
</table>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Body is a doddle. Since it contains HTML we just copy in all the
|
<!-- Body is a doddle. Since it contains HTML we just copy in all the
|
||||||
|
|
Loading…
Reference in a new issue