Skip to content

Commit

Permalink
allow inclusion in stylesheets already have term template
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-srnsw committed Mar 9, 2011
1 parent 3a228c6 commit 62562ba
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions data/stylesheets/include/index.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
<xsl:variable name="first_run">
<xsl:element name="links">
<xsl:apply-templates select="//rda:LinkedTo[@type='index']"/>
<xsl:apply-templates select="//rda:Term"/>
<xsl:call-template name="index_terms">
<xsl:with-param name="terms" select="//rda:Term"/>
</xsl:call-template>
</xsl:element>
</xsl:variable>
<!-- recreate the list of link terms created in the first run and this time add to it, in reverse, all link terms with a narrow term (so the narrow term becomes the broad term and the broad the narrow)-->
<xsl:variable name="raw_terms">
<xsl:element name="links">
<xsl:apply-templates select="//rda:LinkedTo[@type='index']"/>
<xsl:apply-templates select="//rda:Term"/>
<xsl:call-template name="index_terms">
<xsl:with-param name="terms" select="//rda:Term"/>
</xsl:call-template>
<xsl:call-template name="reverse">
<xsl:with-param name="reverse_term" select="exslt:node-set($first_run)/links/link_term[nt]"/>
</xsl:call-template>
Expand Down Expand Up @@ -121,7 +125,9 @@
</xsl:element>
</xsl:template>
<!-- create indexing terms for each function and activity in the authority-->
<xsl:template match="rda:Term">
<xsl:template name="index_terms">
<xsl:param name="terms"/>
<xsl:for-each select="$terms">
<xsl:element name="link_term">
<xsl:element name="bt">
<xsl:value-of select="translate(normalize-space(rda:TermTitle), $upperCaseChars, $lowerCaseChars)"/>
Expand All @@ -145,6 +151,7 @@
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:template>
<!-- reverses the broad and narrow terms in a link-->
<xsl:template name="reverse">
Expand Down

0 comments on commit 62562ba

Please sign in to comment.