OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook-apps] various errors running xslt stylesheet 1.60.1 with xalan 2.5.d1


I haven't run into any of the other errors using Saxon, but the one
regarding FO indexes putting all page references at the primary level, even
from secondary or tertiary indexterms, is a problem in the stylesheets. 

I didn't know whether this was the expected behavior or not, so I didn't
file a bug, but I did do a bit of work on fixing it. Add this template to
your customization layer:

<xsl:template match="indexterm" mode="index-primary">
  <xsl:param name="scope" select="."/>

  <xsl:variable name="key" select="&primary;"/>
  <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
  <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>
      <xsl:otherwise>
        <xsl:copy-of select="$page-number-citations"/>
      </xsl:otherwise>
    </xsl:choose>
  </fo:block>

  <xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::seealso]">
    <fo:block start-indent="1pc">
      <xsl:apply-templates select="$refs[generate-id() =
generate-id(key('see-also', concat(&primary;, &sep;, &sep;, &sep;,
seealso))[&scope;][1])]"
                           mode="index-seealso">
         <xsl:with-param name="scope" select="$scope"/>
         <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
      </xsl:apply-templates>
      <xsl:apply-templates select="$refs[secondary and
count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) =
1]"
                           mode="index-secondary">
       <xsl:with-param name="scope" select="$scope"/>
       <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
      </xsl:apply-templates>
    </fo:block>
  </xsl:if>
</xsl:template>

Jeff


> -----Original Message-----
> From: Jens Skripczynski [mailto:skripi-lists@myrealbox.com]
> Sent: Monday, April 07, 2003 12:29 PM
> Cc: docbook-app
> Subject: [docbook-apps] various errors running xslt stylesheet 1.60.1
> with xalan 2.5.d1
> 
> 2) index entries
>   - <primary>, <secondary>, <tertiary>
>     For each lower level item ( primary > secondary > tertiary)
>     the higher level item gets an additional page reference.
>   e.g.
>   <indexterm><primary>ab</primary></indexterm>
>   <indexterm><primary>ab</primary> <secondary>a1</secondary> 
> </indexterm>
>   <indexterm><primary>ab</primary> <secondary>a2</secondary> 
> </indexterm>
>   lists
>   A
>   ab xx,x1,x2
>     a1  x1
>     a2  x2
> 
>   where i think it should be
>   A
>   ab xx
>     a1  x1
>     a2  x2
> 
>   Is this some wrong asumption on my side ?
>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]