source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml/autoidx-kosek.xsl@ 15c7d39

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 15c7d39 was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 5.3 KB
Line 
1<?xml version="1.0" encoding="ASCII"?>
2<!--This file was created automatically by html2xhtml-->
3<!--from the HTML stylesheets.-->
4<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="http://www.isogen.com/functions/com.isogen.saxoni18n.Saxoni18nService" xmlns:exslt="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" extension-element-prefixes="func exslt" exclude-result-prefixes="func exslt i l k" version="1.0">
5
6<!-- ********************************************************************
7 $Id: autoidx-kosek.xsl 8725 2010-07-15 08:08:04Z kosek $
8 ********************************************************************
9
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://docbook.sf.net/release/xsl/current/ for
12 copyright and other information.
13
14 ******************************************************************** -->
15
16<!-- ==================================================================== -->
17<!-- The "kosek" method contributed by Jirka Kosek. -->
18
19<xsl:include href="../common/autoidx-kosek.xsl"/>
20
21<xsl:template name="generate-kosek-index">
22 <xsl:param name="scope" select="(ancestor::book|/)[last()]"/>
23
24 <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
25 <xsl:if test="contains($vendor, 'libxslt')">
26 <xsl:message terminate="yes">
27 <xsl:text>ERROR: the 'kosek' index method does not </xsl:text>
28 <xsl:text>work with the xsltproc XSLT processor.</xsl:text>
29 </xsl:message>
30 </xsl:if>
31
32 <xsl:if test="contains($vendor, 'Saxonica')">
33 <xsl:message terminate="yes">
34 <xsl:text>ERROR: the 'kosek' index method does not </xsl:text>
35 <xsl:text>work with the Saxon 8 XSLT processor.</xsl:text>
36 </xsl:message>
37 </xsl:if>
38
39 <xsl:if test="$exsl.node.set.available = 0">
40 <xsl:message terminate="yes">
41 <xsl:text>ERROR: the 'kosek' index method requires the </xsl:text>
42 <xsl:text>exslt:node-set() function. Use a processor that </xsl:text>
43 <xsl:text>has it, or use a different index method.</xsl:text>
44 </xsl:message>
45 </xsl:if>
46
47 <xsl:if test="not(function-available('i:group-index'))">
48 <xsl:message terminate="yes">
49 <xsl:text>ERROR: the 'kosek' index method requires the
50</xsl:text>
51 <xsl:text>index extension functions be imported:
52</xsl:text>
53 <xsl:text> xsl:import href="common/autoidx-kosek.xsl"</xsl:text>
54 </xsl:message>
55 </xsl:if>
56
57 <xsl:variable name="role">
58 <xsl:if test="$index.on.role != 0">
59 <xsl:value-of select="@role"/>
60 </xsl:if>
61 </xsl:variable>
62
63 <xsl:variable name="type">
64 <xsl:if test="$index.on.type != 0">
65 <xsl:value-of select="@type"/>
66 </xsl:if>
67 </xsl:variable>
68
69 <xsl:variable name="terms" select="//indexterm[count(.|key('group-code', i:group-index(normalize-space(concat(primary/@sortas, &quot; &quot;, primary))))[count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))][1]) = 1 and not(@class = 'endofrange')]"/>
70
71 <div class="index">
72 <xsl:apply-templates select="$terms" mode="index-div-kosek">
73 <xsl:with-param name="scope" select="$scope"/>
74 <xsl:with-param name="role" select="$role"/>
75 <xsl:with-param name="type" select="$type"/>
76 <xsl:sort select="i:group-index(normalize-space(concat(primary/@sortas, &quot; &quot;, primary)))" data-type="number"/>
77 </xsl:apply-templates>
78 </div>
79</xsl:template>
80
81<xsl:template match="indexterm" mode="index-div-kosek">
82 <xsl:param name="scope" select="."/>
83 <xsl:param name="role" select="''"/>
84 <xsl:param name="type" select="''"/>
85
86 <xsl:variable name="key" select="i:group-index(normalize-space(concat(primary/@sortas, &quot; &quot;, primary)))"/>
87
88 <xsl:variable name="lang">
89 <xsl:call-template name="l10n.language"/>
90 </xsl:variable>
91
92 <xsl:if test="key('group-code', $key)[count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))][count(.|key('primary', normalize-space(concat(primary/@sortas, &quot; &quot;, primary)))[count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))][1]) = 1]">
93 <div class="indexdiv">
94 <h3>
95 <xsl:value-of select="i:group-letter($key)"/>
96 </h3>
97 <dl>
98 <xsl:apply-templates select="key('group-code', $key)[count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))][count(.|key('primary', normalize-space(concat(primary/@sortas, &quot; &quot;, primary)))[count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))][1])=1]" mode="index-primary">
99 <xsl:sort select="normalize-space(concat(primary/@sortas, &quot; &quot;, primary))" lang="{$lang}"/>
100 <xsl:with-param name="scope" select="$scope"/>
101 <xsl:with-param name="role" select="$role"/>
102 <xsl:with-param name="type" select="$type"/>
103 </xsl:apply-templates>
104 </dl>
105 </div>
106 </xsl:if>
107</xsl:template>
108
109</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.