]> granicus.if.org Git - docbook-dsssl/commitdiff
Updated i18n indexing method to support new type attribute and index.on.type parameter
authorJirka Kosek <jirka@kosek.cz>
Mon, 14 Jun 2004 09:14:07 +0000 (09:14 +0000)
committerJirka Kosek <jirka@kosek.cz>
Mon, 14 Jun 2004 09:14:07 +0000 (09:14 +0000)
xsl/fo/autoidx-ng.xsl
xsl/html/Makefile.param
xsl/html/autoidx-ng.xsl

index 1e7e45ec3ee5ce21d67983cb190edc5ac2d315ed..87d612403136e7b7069449b133d55c1e1ff7280d 100755 (executable)
@@ -10,7 +10,8 @@
 
 <!ENTITY sep '" "'>
 <!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())
-                and ($role = @role or string-length($role) = 0)'>
+                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:fo="http://www.w3.org/1999/XSL/Format"
     </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
@@ -50,6 +57,7 @@
   <xsl:apply-templates select="$terms" mode="index-div">
     <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>
 </xsl:template>
@@ -57,6 +65,7 @@
 <xsl:template match="indexterm" mode="index-div">
   <xsl:param name="scope" select="."/>
   <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
 
   <xsl:variable name="key"
                 select="i:group-index(&primary;)"/>
@@ -76,6 +85,7 @@
           <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
           <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>
index 12b0952b9fb2e4d8325976a44ccb801c7e62e4b5..8f64e5a074310a6feb331a9eaf751f4042c3e8e8 100644 (file)
@@ -25,6 +25,7 @@ PARAMS=../params/admon.graphics.xml \
        ../params/chunk.first.sections.xml \
        ../params/chunk.quietly.xml \
        ../params/chunk.section.depth.xml \
+       ../params/chunk.separate.lots.xml \
        ../params/chunk.toc.xml \
        ../params/chunker.output.cdata-section-elements.xml \
        ../params/chunker.output.doctype-public.xml \
@@ -120,6 +121,8 @@ PARAMS=../params/admon.graphics.xml \
        ../params/htmlhelp.title.xml \
        ../params/htmlhelp.use.hhk.xml \
        ../params/htmlhelp.window.geometry.xml \
+       ../params/index.on.role.xml \
+       ../params/index.on.type.xml \
        ../params/inherit.keywords.xml \
        ../params/label.from.part.xml \
        ../params/linenumbering.everyNth.xml \
index c47445fa1cc2ac3a2d6b74c6ea081db96472272e..73948d6caaea4d73da9bec0301db19d0f35ea428 100755 (executable)
@@ -10,7 +10,8 @@
 
 <!ENTITY sep '" "'>
 <!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())
-                and ($role = @role or string-length($role) = 0)'>
+                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:fo="http://www.w3.org/1999/XSL/Format"
     </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
@@ -51,6 +58,7 @@
     <xsl:apply-templates select="$terms" mode="index-div">
       <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>
@@ -59,6 +67,7 @@
 <xsl:template match="indexterm" mode="index-div">
   <xsl:param name="scope" select="."/>
   <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
 
   <xsl:variable name="key"
                 select="i:group-index(&primary;)"/>
@@ -76,6 +85,7 @@
           <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
           <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>