]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:rx="http://www.renderx.com/XSL/Extensions"
version="1.0">
<!-- ********************************************************************
<fo:block>
<xsl:value-of select="primary"/>
- <xsl:variable name="page-number-citations">
- <xsl:for-each select="$refs[not(see) and not(seealso)
- and not(secondary)]">
- <xsl:apply-templates select="." mode="reference">
- <xsl:with-param name="scope" select="$scope"/>
- </xsl:apply-templates>
- </xsl:for-each>
-
- <xsl:if test="$refs[not(secondary)]/*[self::see]">
- <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[&scope;][1])]"
- mode="index-see">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:variable>
-
<xsl:choose>
- <xsl:when test="$passivetex.extensions != '0'">
- <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
- <xsl:copy-of select="$page-number-citations"/>
- </fotex:sort>
+ <xsl:when test="$xep.extensions != 0">
+ <xsl:if test="$refs[not(see) and not(seealso) and not(secondary)]">
+ <xsl:text>, </xsl:text>
+ <rx:page-index>
+ <rx:index-item xsl:use-attribute-sets="xep.index.item.properties">
+ <xsl:attribute name="ref-key">
+ <xsl:value-of select="primary"/>
+ </xsl:attribute>
+ </rx:index-item>
+ </rx:page-index>
+ </xsl:if>
</xsl:when>
<xsl:otherwise>
- <xsl:copy-of select="$page-number-citations"/>
+ <xsl:variable name="page-number-citations">
+ <xsl:for-each select="$refs[not(see) and not(seealso)
+ and not(secondary)]">
+ <xsl:apply-templates select="." mode="reference">
+ <xsl:with-param name="scope" select="$scope"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$passivetex.extensions != '0'">
+ <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
+ <xsl:copy-of select="$page-number-citations"/>
+ </fotex:sort>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$page-number-citations"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:otherwise>
</xsl:choose>
+
+ <xsl:if test="$refs[not(secondary)]/*[self::see]">
+ <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[&scope;][1])]"
+ mode="index-see">
+ <xsl:with-param name="scope" select="$scope"/>
+ <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
+ </xsl:apply-templates>
+ </xsl:if>
+
</fo:block>
<xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::seealso]">
<fo:block>
<xsl:value-of select="secondary"/>
- <xsl:variable name="page-number-citations">
- <xsl:for-each select="$refs[not(see) and not(seealso)
- and not(tertiary)]">
- <xsl:apply-templates select="." mode="reference">
- <xsl:with-param name="scope" select="$scope"/>
- </xsl:apply-templates>
- </xsl:for-each>
-
- <xsl:if test="$refs[not(tertiary)]/*[self::see]">
- <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, see))[&scope;][1])]"
- mode="index-see">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:variable>
-
<xsl:choose>
- <xsl:when test="$passivetex.extensions != '0'">
- <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
- <xsl:copy-of select="$page-number-citations"/>
- </fotex:sort>
+ <xsl:when test="$xep.extensions != 0">
+ <xsl:if test="$refs[not(see) and not(seealso) and not(tertiary)]">
+ <xsl:text>, </xsl:text>
+ <rx:page-index>
+ <rx:index-item xsl:use-attribute-sets="xep.index.item.properties">
+ <xsl:attribute name="ref-key">
+ <xsl:value-of select="primary"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="secondary"/>
+ </xsl:attribute>
+ </rx:index-item>
+ </rx:page-index>
+ </xsl:if>
</xsl:when>
<xsl:otherwise>
- <xsl:copy-of select="$page-number-citations"/>
+ <xsl:variable name="page-number-citations">
+ <xsl:for-each select="$refs[not(see) and not(seealso)
+ and not(tertiary)]">
+ <xsl:apply-templates select="." mode="reference">
+ <xsl:with-param name="scope" select="$scope"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$passivetex.extensions != '0'">
+ <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
+ <xsl:copy-of select="$page-number-citations"/>
+ </fotex:sort>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$page-number-citations"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:otherwise>
</xsl:choose>
+
+ <xsl:if test="$refs[not(tertiary)]/*[self::see]">
+ <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, see))[&scope;][1])]"
+ mode="index-see">
+ <xsl:with-param name="scope" select="$scope"/>
+ <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
+ </xsl:apply-templates>
+ </xsl:if>
+
</fo:block>
<xsl:if test="$refs/tertiary or $refs[not(tertiary)]/*[self::seealso]">
<fo:block>
<xsl:value-of select="tertiary"/>
- <xsl:variable name="page-number-citations">
- <xsl:for-each select="$refs[not(see) and not(seealso)]">
- <xsl:apply-templates select="." mode="reference">
- <xsl:with-param name="scope" select="$scope"/>
- </xsl:apply-templates>
- </xsl:for-each>
-
- <xsl:if test="$refs/see">
- <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see))[&scope;][1])]"
- mode="index-see">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:variable>
-
<xsl:choose>
- <xsl:when test="$passivetex.extensions != '0'">
- <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
- <xsl:copy-of select="$page-number-citations"/>
- </fotex:sort>
+ <xsl:when test="$xep.extensions != 0">
+ <xsl:if test="$refs[not(see) and not(seealso)]">
+ <xsl:text>, </xsl:text>
+ <rx:page-index>
+ <rx:index-item xsl:use-attribute-sets="xep.index.item.properties">
+ <xsl:attribute name="ref-key">
+ <xsl:value-of select="primary"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="secondary"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="tertiary"/>
+ </xsl:attribute>
+ </rx:index-item>
+ </rx:page-index>
+ </xsl:if>
</xsl:when>
<xsl:otherwise>
- <xsl:copy-of select="$page-number-citations"/>
+ <xsl:variable name="page-number-citations">
+ <xsl:for-each select="$refs[not(see) and not(seealso)]">
+ <xsl:apply-templates select="." mode="reference">
+ <xsl:with-param name="scope" select="$scope"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$passivetex.extensions != '0'">
+ <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
+ <xsl:copy-of select="$page-number-citations"/>
+ </fotex:sort>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$page-number-citations"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:otherwise>
</xsl:choose>
+
+ <xsl:if test="$refs/see">
+ <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see))[&scope;][1])]"
+ mode="index-see">
+ <xsl:with-param name="scope" select="$scope"/>
+ <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
+ </xsl:apply-templates>
+ </xsl:if>
+
</fo:block>
<xsl:if test="$refs/seealso">
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:rx="http://www.renderx.com/XSL/Extensions"
version='1.0'>
<!-- ********************************************************************
<!-- ==================================================================== -->
-<xsl:template match="indexterm">
+<xsl:template match="indexterm" name="indexterm">
<fo:wrapper>
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
- <xsl:comment>
- <xsl:call-template name="comment-escape-string">
- <xsl:with-param name="string">
+ <xsl:choose>
+ <xsl:when test="$xep.extensions != 0">
+ <xsl:attribute name="rx:key">
<xsl:value-of select="primary"/>
<xsl:if test="secondary">
<xsl:text>, </xsl:text>
<xsl:text>, </xsl:text>
<xsl:value-of select="tertiary"/>
</xsl:if>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:comment>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:comment>
+ <xsl:call-template name="comment-escape-string">
+ <xsl:with-param name="string">
+ <xsl:value-of select="primary"/>
+ <xsl:if test="secondary">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="secondary"/>
+ </xsl:if>
+ <xsl:if test="tertiary">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="tertiary"/>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:comment>
+ </xsl:otherwise>
+ </xsl:choose>
</fo:wrapper>
</xsl:template>
+<xsl:template match="indexterm[@class='startofrange']">
+ <xsl:choose>
+ <xsl:when test="$xep.extensions != 0">
+ <rx:begin-index-range>
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+
+ <xsl:attribute name="rx:key">
+ <xsl:value-of select="primary"/>
+ <xsl:if test="secondary">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="secondary"/>
+ </xsl:if>
+ <xsl:if test="tertiary">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="tertiary"/>
+ </xsl:if>
+ </xsl:attribute>
+ </rx:begin-index-range>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="indexterm"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="indexterm[@class='endofrange']">
+ <xsl:choose>
+ <xsl:when test="$xep.extensions != 0">
+ <rx:end-index-range>
+ <xsl:attribute name="ref-id">
+ <xsl:value-of select="@startref"/>
+ </xsl:attribute>
+ </rx:end-index-range>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="indexterm"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
<!-- ==================================================================== -->
<xsl:template match="indexentry">