This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] various errors running xslt stylesheet 1.60.1 with xalan 2.5.d1
- From: Bob Stayton <bobs at sco dot com>
- To: Jeff Beal <jeff dot beal at ansys dot com>
- Cc: 'Jens Skripczynski' <skripi-lists at myrealbox dot com>,docbook-app <docbook-apps at lists dot oasis-open dot org>
- Date: Mon, 7 Apr 2003 14:18:21 -0700
- Subject: Re: [docbook-apps] various errors running xslt stylesheet 1.60.1 with xalan 2.5.d1
- References: <E08C8F26F6901D42B1201763D125853801A5CB8F@ntdevexc.win.ansys.com>
Thanks for this, Jeff.
I went ahead and checked your fix into the CVS tree,
along with a similar one for secondary entries
getting tertiary numbers.
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
The SCO Group fax: (831) 429-1887
email: bobs at sco dot com
On Mon, Apr 07, 2003 at 12:40:58PM -0400, Jeff Beal wrote:
> 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 at myrealbox dot 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 ?
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe at lists dot oasis-open dot org
> For additional commands, e-mail: docbook-apps-help at lists dot oasis-open dot org
>
>
--
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
The SCO Group fax: (831) 429-1887
email: bobs at sco dot com
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe at lists dot oasis-open dot org
For additional commands, e-mail: docbook-apps-help at lists dot oasis-open dot org