[xml/sgml-pkgs] Bug#285155: can't collect.targets and make index at the same time

Cai Qian Cai Qian <caiqian@gnome.org>, 285155@bugs.debian.org
Sat, 11 Dec 2004 10:02:48 +0800


Package: xsltproc
Version: 1.1.8-5
Severity: important

1.1.11 and 1.1.12 just behave right, so it is better to upgrade. 

Here is example.
Sample XML file(1.xml)
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.docbook.org/xml/4.3/docbookx.dtd">
<book>
  <chapter>
    <title>INTRO</title>
    <sect1>
      <title>welcome</title>
      <indexterm>
        <primary>#</primary>
        <secondary>GOOD</secondary>
      </indexterm>
    </sect1>
  </chapter>
  <index/>
</book>

Sample stylesheet(1.xsl)
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
  <xsl:import
href="/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/profile-chunk.xsl" />
  <xsl:param name="generate.index">1</xsl:param> 
  <xsl:param name="collect.xref.targets" select="'yes'" />
  <xsl:param name="targets.filename" select="'target.xml'" />
  <xsl:param name="make.valid.html" select="1" />
  <xsl:param name="chunker.output.indent" select="'yes'" />
<xsl:stylesheet/>

Then I use `xsltproc 1.xsl 1.xml` to transform it to HTML, but the back
cover index is empty. However, if I commented out these two lines
  <xsl:param name="targets.filename" select="'target.xml'" />
  <xsl:param name="make.valid.html" select="1" />
. Everything is fine.

I just debuged it and found in file html/autoidx.xsl (Maybe
xhtml/autoidx.xsl, but it seems it was generated from above.)
<xsl:template match="indexterm" mode="index-symbol-div">
   ...
  <xsl:apply-templates select="key('letter', $key)
      ...
       [&scope;][count(.|key('primary',&primary;)[1]) = 1]"
                       mode="index-primary">
      ...
  ...

The statement "count(.|key('primary',&primary;)[1])" is going to "2", so
the "select" is ''. I don't how collect.xref.targets make it wrong. 




-- 
Cai Qian