<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
-<!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'">
-<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
+<!ENTITY lowercase "'AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ'">
+<!ENTITY uppercase "'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ'">
+
<!ENTITY primary 'normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = ""]))'>
<!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas) or @sortas = ""]))'>
<!ENTITY tertiary 'normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas) or @sortas = ""]))'>
<!ENTITY sep '" "'>
-<!-- Documents using the kimber index method must have a lang attribute -->
-<!-- Only one of these should be present in the entity -->
-
-<!ENTITY lang 'concat(/*/@lang, /*/@xml:lang)'>
<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())
and ($role = @role or $type = @type or
(string-length($role) = 0 and string-length($type) = 0))'>
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:rx="http://www.renderx.com/XSL/Extensions"
xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
- xmlns:i="urn:cz-kosek:functions:index"
- xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
- xmlns:func="http://exslt.org/functions"
- xmlns:k="java:com.isogen.saxoni18n.Saxoni18nService"
xmlns:exslt="http://exslt.org/common"
- extension-element-prefixes="func exslt"
- exclude-result-prefixes="func exslt i l k"
+ extension-element-prefixes="exslt"
+ exclude-result-prefixes="exslt"
version="1.0">
<!-- ********************************************************************
******************************************************************** -->
<!-- ==================================================================== -->
-<!-- The "english" method derived from Jeni Tennison's work. -->
+<!-- The "basic" method derived from Jeni Tennison's work. -->
<!-- The "kosek" method contributed by Jirka Kosek. -->
<!-- The "kimber" method contributed by Eliot Kimber of Innodata Isogen. -->
+<!-- Importing module for kimber or kosek method overrides one of these -->
+<xsl:param name="kimber.imported" select="0"/>
+<xsl:param name="kosek.imported" select="0"/>
+
<!-- These keys used primary in all methods -->
<xsl:key name="letter"
match="indexterm"
&tertiary;, &sep;, see)"/>
-<!-- The following key is used in the kimber indexing method.
- To use this method, either copy this key to a
- customization layer, or xsl:import common/autoidx.xsl. -->
-<!--
-<xsl:key name="k-group"
- match="indexterm"
- use="k:getIndexGroupKey(⟨, &primary;)"/>
--->
-
-
<xsl:template name="generate-index">
<xsl:param name="scope" select="(ancestor::book|/)[last()]"/>
</xsl:when>
<xsl:otherwise>
- <xsl:call-template name="generate-english-index">
+ <xsl:call-template name="generate-basic-index">
<xsl:with-param name="scope" select="$scope"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-<xsl:template name="generate-english-index">
+<xsl:template name="generate-basic-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:variable name="role">
translate(substring(&primary;, 1, 1),
&lowercase;,&uppercase;))
[&scope;][1]) = 1]"
- mode="index-div-english">
+ mode="index-div-basic">
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</fo:block>
</xsl:template>
+<!-- This template not used if fo/autoidx-kosek.xsl is imported -->
<xsl:template name="generate-kosek-index">
<xsl:param name="scope" select="NOTANODE"/>
</xsl:message>
</xsl:if>
- <xsl:if test="not(function-available('i:group-index'))">
+ <xsl:if test="$kosek.imported = 0">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method requires the
</xsl:text>
- <xsl:text>index extension functions be imported:
</xsl:text>
- <xsl:text> xsl:import href="common/autoidx-ng.xsl"</xsl:text>
+ <xsl:text>kosek index extensions be imported:
</xsl:text>
+ <xsl:text> xsl:import href="fo/autoidx-kosek.xsl"</xsl:text>
</xsl:message>
</xsl:if>
- <xsl:variable name="role">
- <xsl:if test="$index.on.role != 0">
- <xsl:value-of select="@role"/>
- </xsl:if>
- </xsl:variable>
-
- <xsl:variable name="type">
- <xsl:if test="$index.on.type != 0">
- <xsl:value-of select="@type"/>
- </xsl:if>
- </xsl:variable>
-
- <xsl:variable name="terms"
- select="//indexterm[count(.|key('group-code',
- i:group-index(&primary;))
- [&scope;][1]) = 1
- and not(@class = 'endofrange')]"/>
- <fo:block>
- <xsl:apply-templates select="$terms" mode="index-div-kosek">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort select="i:group-index(&primary;)" data-type="number"/>
- </xsl:apply-templates>
- </fo:block>
</xsl:template>
+<!-- This template not used if fo/autoidx-kimber.xsl is imported -->
<xsl:template name="generate-kimber-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:if test="not(contains($vendor, 'SAXON '))">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kimber' index method requires the </xsl:text>
- <xsl:text>Saxon version 6 XSLT processor.</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:if test="not(function-available('k:getIndexGroupKey'))">
- <xsl:message terminate="yes">
- <xsl:text>ERROR: the 'kimber' index method requires the </xsl:text>
- <xsl:text>Innodata Isogen 
Java extensions for </xsl:text>
- <xsl:text>internationalized indexes. 
Install those </xsl:text>
- <xsl:text>extensions, or use a different index method.
</xsl:text>
- <xsl:text>For more information, see:
</xsl:text>
- <xsl:text>http://www.innodata-isogen.com/knowledge_center/tools_downloads/i18nsupport</xsl:text>
+ <xsl:text>Saxon version 6 or 8 XSLT processor.</xsl:text>
</xsl:message>
</xsl:if>
- <xsl:if test="not(function-available('i:group-index'))">
+ <xsl:if test="$kimber.imported = 0">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kimber' index method requires the
</xsl:text>
- <xsl:text>index extension functions be imported:
</xsl:text>
- <xsl:text> xsl:import href="common/autoidx-ng.xsl"</xsl:text>
+ <xsl:text>kimber index extensions be imported:
</xsl:text>
+ <xsl:text> xsl:import href="fo/autoidx-kimber.xsl"</xsl:text>
</xsl:message>
</xsl:if>
- <xsl:variable name="role">
- <xsl:if test="$index.on.role != 0">
- <xsl:value-of select="@role"/>
- </xsl:if>
- </xsl:variable>
-
- <xsl:variable name="type">
- <xsl:if test="$index.on.type != 0">
- <xsl:value-of select="@type"/>
- </xsl:if>
- </xsl:variable>
-
- <xsl:variable name="terms"
- select="//indexterm[count(.|key('k-group',
- k:getIndexGroupKey(⟨, &primary;))
- [&scope;][1]) = 1
- and not(@class = 'endofrange')]"/>
-
- <xsl:variable name="alphabetical"
- select="$terms[not(starts-with(
- k:getIndexGroupKey(⟨, &primary;),
- '#NUMERIC'
- ))]"/>
-
- <xsl:variable name="others"
- select="$terms[starts-with(
- k:getIndexGroupKey(⟨, &primary;),
- '#NUMERIC'
- )]"/>
-
- <fo:block>
- <xsl:if test="$others">
- <xsl:call-template name="indexdiv.title">
- <xsl:with-param name="titlecontent">
- <xsl:call-template name="gentext">
- <xsl:with-param name="key" select="'index symbols'"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
-
- <fo:block>
- <xsl:apply-templates select="$others"
- mode="index-symbol-div">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort lang="{⟨}"
- select="k:getIndexGroupSortKey(⟨,
- k:getIndexGroupKey(⟨, &primary;))"/>
- </xsl:apply-templates>
- </fo:block>
- </xsl:if>
-
- <xsl:apply-templates select="$alphabetical"
- mode="index-div-kimber">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort lang="{⟨}"
- select="k:getIndexGroupSortKey(⟨,
- k:getIndexGroupKey(⟨, &primary;))"/>
- </xsl:apply-templates>
- </fo:block>
-
</xsl:template>
-<xsl:template match="indexterm" mode="index-div-english">
+<xsl:template match="indexterm" mode="index-div-basic">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
</fo:block>
</xsl:template>
-<xsl:template match="indexterm" mode="index-div-kosek">
- <xsl:param name="scope" select="."/>
- <xsl:param name="role" select="''"/>
- <xsl:param name="type" select="''"/>
-
- <xsl:variable name="key"
- select="i:group-index(&primary;)"/>
-
- <xsl:variable name="lang">
- <xsl:call-template name="l10n.language"/>
- </xsl:variable>
-
- <xsl:if test="key('group-code', $key)[&scope;]
- [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
- <fo:block>
- <xsl:call-template name="indexdiv.title">
- <xsl:with-param name="titlecontent">
- <xsl:choose>
- <xsl:when test="$key = 0">
- <xsl:call-template name="gentext">
- <xsl:with-param name="key" select="'index symbols'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="i:group-letter($key)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- <fo:block>
- <xsl:apply-templates select="key('group-code', $key)[&scope;]
- [count(.|key('primary', &primary;)
- [&scope;][1])=1]"
- mode="index-primary">
- <xsl:sort select="&primary;" lang="{$lang}"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- </xsl:apply-templates>
- </fo:block>
- </fo:block>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="indexterm" mode="index-div-kimber">
- <xsl:param name="scope" select="."/>
- <xsl:param name="role" select="''"/>
- <xsl:param name="type" select="''"/>
-
- <xsl:variable name="key"
- select="k:getIndexGroupKey(⟨, &primary;)"/>
-
- <xsl:variable name="label"
- select="k:getIndexGroupLabel(⟨, $key)"/>
-
- <xsl:if test="key('k-group', $label)[&scope;]
- [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
- <fo:block>
- <xsl:call-template name="indexdiv.title">
- <xsl:with-param name="titlecontent">
- <xsl:value-of select="$label"/>
- </xsl:with-param>
- </xsl:call-template>
- <fo:block>
- <xsl:apply-templates select="key('k-group', $key)[&scope;]
- [count(.|key('primary', &primary;)[&scope;]
- [1])=1]"
- mode="index-primary">
- <xsl:sort select="&primary;" lang="{⟨}"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- </xsl:apply-templates>
- </fo:block>
- </fo:block>
- </xsl:if>
-</xsl:template>
-
-
<xsl:template match="indexterm" mode="index-primary">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
-<!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'">
-<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
+<!ENTITY lowercase "'AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ'">
+<!ENTITY uppercase "'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ'">
<!ENTITY primary 'normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = ""]))'>
<!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas) or @sortas = ""]))'>
<!ENTITY section.id 'generate-id(§ion;)'>
<!ENTITY sep '" "'>
-<!-- Documents using the kimber index method must have a lang attribute -->
-<!-- Only one of these should be present in the entity -->
-<!ENTITY lang 'concat(/*/@lang, /*/@xml:lang)'>
<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())
and ($role = @role or $type = @type or
(string-length($role) = 0 and string-length($type) = 0))'>
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:i="urn:cz-kosek:functions:index"
- xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
- xmlns:func="http://exslt.org/functions"
- xmlns:k="java:com.isogen.saxoni18n.Saxoni18nService"
xmlns:exslt="http://exslt.org/common"
- extension-element-prefixes="func exslt"
- exclude-result-prefixes="func exslt i l k"
+ extension-element-prefixes="exslt"
+ exclude-result-prefixes="exslt"
version="1.0">
<!-- ********************************************************************
******************************************************************** -->
<!-- ==================================================================== -->
-<!-- The "english" method derived from Jeni Tennison's work. -->
+<!-- The "basic" method derived from Jeni Tennison's work. -->
<!-- The "kosek" method contributed by Jirka Kosek. -->
<!-- The "kimber" method contributed by Eliot Kimber of Innodata Isogen. -->
+<xsl:variable name="kimber.imported" select="0"/>
+<xsl:variable name="kosek.imported" select="0"/>
+
<xsl:key name="letter"
match="indexterm"
use="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
<xsl:key name="sections" match="*[@id]" use="@id"/>
-<!-- The following key is used in the kimber indexing method.
- To use this method, either copy this key to a
- customization layer, or xsl:import common/autoidx-ng.xsl. -->
-<!--
-<xsl:key name="k-group"
- match="indexterm"
- use="k:getIndexGroupKey(⟨, &primary;)"/>
--->
-
<xsl:template name="generate-index">
<xsl:param name="scope" select="(ancestor::book|/)[last()]"/>
</xsl:when>
<xsl:otherwise>
- <xsl:call-template name="generate-english-index">
+ <xsl:call-template name="generate-basic-index">
<xsl:with-param name="scope" select="$scope"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-<xsl:template name="generate-english-index">
+<xsl:template name="generate-basic-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:variable name="role">
<xsl:apply-templates select="$alphabetical[count(.|key('letter',
translate(substring(&primary;, 1, 1),
&lowercase;,&uppercase;))[&scope;][1]) = 1]"
- mode="index-div-english">
+ mode="index-div-basic">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
</div>
</xsl:template>
+<!-- This template not used if html/autoidx-kosek.xsl is imported -->
<xsl:template name="generate-kosek-index">
- <xsl:param name="scope" select="(ancestor::book|/)[last()]"/>
+ <xsl:param name="scope" select="NOTANODE"/>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:if test="contains($vendor, 'libxslt')">
</xsl:message>
</xsl:if>
- <xsl:if test="not(function-available('i:group-index'))">
+ <xsl:if test="$kosek.imported = 0">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method requires the
</xsl:text>
- <xsl:text>index extension functions be imported:
</xsl:text>
- <xsl:text> xsl:import href="common/autoidx-ng.xsl"</xsl:text>
+ <xsl:text>kosek index extensions be imported:
</xsl:text>
+ <xsl:text> xsl:import href="html/autoidx-kosek.xsl"</xsl:text>
</xsl:message>
</xsl:if>
- <xsl:variable name="role">
- <xsl:if test="$index.on.role != 0">
- <xsl:value-of select="@role"/>
- </xsl:if>
- </xsl:variable>
-
- <xsl:variable name="type">
- <xsl:if test="$index.on.type != 0">
- <xsl:value-of select="@type"/>
- </xsl:if>
- </xsl:variable>
-
- <xsl:variable name="terms"
- select="//indexterm[count(.|key('group-code',
- i:group-index(&primary;))
- [&scope;][1]) = 1
- and not(@class = 'endofrange')]"/>
-
- <div class="index">
- <xsl:apply-templates select="$terms" mode="index-div-kosek">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort select="i:group-index(&primary;)" data-type="number"/>
- </xsl:apply-templates>
- </div>
</xsl:template>
+<!-- This template not used if html/autoidx-kimber.xsl is imported -->
<xsl:template name="generate-kimber-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:if test="not(contains($vendor, 'SAXON '))">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kimber' index method requires the </xsl:text>
- <xsl:text>Saxon version 6 XSLT processor.</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:if test="not(function-available('k:getIndexGroupKey'))">
- <xsl:message terminate="yes">
- <xsl:text>ERROR: the 'kimber' index method requires the </xsl:text>
- <xsl:text>Innodata Isogen 
Java extensions for </xsl:text>
- <xsl:text>internationalized indexes. 
Install those </xsl:text>
- <xsl:text>extensions, or use a different index method.
</xsl:text>
- <xsl:text>For more information, see:
</xsl:text>
- <xsl:text>http://www.innodata-isogen.com/knowledge_center/tools_downloads/i18nsupport</xsl:text>
+ <xsl:text>Saxon version 6 or 8 XSLT processor.</xsl:text>
</xsl:message>
</xsl:if>
- <xsl:if test="not(function-available('i:group-index'))">
+ <xsl:if test="$kimber.imported = 0">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kimber' index method requires the
</xsl:text>
- <xsl:text>index extension functions be imported:
</xsl:text>
- <xsl:text> xsl:import href="common/autoidx-ng.xsl"</xsl:text>
+ <xsl:text>kimber index extensions be imported:
</xsl:text>
+ <xsl:text> xsl:import href="html/autoidx-kimber.xsl"</xsl:text>
</xsl:message>
</xsl:if>
- <xsl:variable name="role">
- <xsl:if test="$index.on.role != 0">
- <xsl:value-of select="@role"/>
- </xsl:if>
- </xsl:variable>
-
- <xsl:variable name="type">
- <xsl:if test="$index.on.type != 0">
- <xsl:value-of select="@type"/>
- </xsl:if>
- </xsl:variable>
-
- <xsl:variable name="terms"
- select="//indexterm[count(.|key('k-group',
- k:getIndexGroupKey(⟨, &primary;))
- [&scope;][1]) = 1
- and not(@class = 'endofrange')]"/>
-
- <xsl:variable name="alphabetical"
- select="$terms[not(starts-with(
- k:getIndexGroupKey(⟨, &primary;),
- '#NUMERIC'
- ))]"/>
-
- <xsl:variable name="others"
- select="$terms[starts-with(
- k:getIndexGroupKey(⟨, &primary;),
- '#NUMERIC'
- )]"/>
-
- <div class="index">
- <xsl:if test="$others">
- <div class="indexdev">
- <h3>
- <xsl:call-template name="gentext">
- <xsl:with-param name="key" select="'index symbols'"/>
- </xsl:call-template>
- </h3>
- <dl>
- <xsl:apply-templates select="$others"
- mode="index-symbol-div">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort lang="{⟨}"
- select="k:getIndexGroupSortKey(⟨,
- k:getIndexGroupKey(⟨, &primary;))"/>
- </xsl:apply-templates>
- </dl>
- </div>
- </xsl:if>
-
- <xsl:apply-templates select="$alphabetical"
- mode="index-div-kimber">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort lang="{⟨}"
- select="k:getIndexGroupSortKey(⟨,
- k:getIndexGroupKey(⟨, &primary;))"/>
- </xsl:apply-templates>
- </div>
-
</xsl:template>
-<xsl:template match="indexterm" mode="index-div-english">
+<xsl:template match="indexterm" mode="index-div-basic">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
</xsl:apply-templates>
</xsl:template>
-<xsl:template match="indexterm" mode="index-div-kosek">
- <xsl:param name="scope" select="."/>
- <xsl:param name="role" select="''"/>
- <xsl:param name="type" select="''"/>
-
- <xsl:variable name="key"
- select="i:group-index(&primary;)"/>
-
- <xsl:variable name="lang">
- <xsl:call-template name="l10n.language"/>
- </xsl:variable>
-
- <xsl:if test="key('group-code', $key)[&scope;]
- [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
- <div class="indexdiv">
- <h3>
- <xsl:value-of select="i:group-letter($key)"/>
- </h3>
- <dl>
- <xsl:apply-templates select="key('group-code', $key)[&scope;]
- [count(.|key('primary', &primary;)[&scope;][1])=1]"
- mode="index-primary">
- <xsl:sort select="&primary;" lang="{$lang}"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- </xsl:apply-templates>
- </dl>
- </div>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="indexterm" mode="index-div-kimber">
- <xsl:param name="scope" select="."/>
- <xsl:param name="role" select="''"/>
- <xsl:param name="type" select="''"/>
-
- <xsl:variable name="key"
- select="k:getIndexGroupKey(⟨, &primary;)"/>
-
- <xsl:variable name="label"
- select="k:getIndexGroupLabel(⟨, $key)"/>
-
- <xsl:if test="key('k-group', $label)[&scope;]
- [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
- <div class="indexdiv">
- <h3>
- <xsl:value-of select="$label"/>
- </h3>
- <dl>
- <xsl:apply-templates select="key('k-group', $key)[&scope;]
- [count(.|key('primary', &primary;)[&scope;]
- [1])=1]"
- mode="index-primary">
- <xsl:sort select="&primary;" lang="{⟨}"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- </xsl:apply-templates>
- </dl>
- </div>
- </xsl:if>
-</xsl:template>
-
<xsl:template match="indexterm" mode="index-primary">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>