This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] xref within index
- From: "Bob Stayton" <bobs at sagehill dot net>
- To: "Ilana Kingsley" <kingsley at arsc dot edu>, <docbook-apps at lists dot oasis-open dot org>
- Date: Mon, 10 May 2004 14:41:46 -0700
- Subject: Re: [docbook-apps] xref within index
- References: <Pine.SGI.4.58.0405101111380.776432@muskox.arsc.edu>
Hi,
The template you want to customize is this one in xhtml/index.xsl:
<xsl:template match="indexentry">
<xsl:apply-templates select="primaryie"/>
</xsl:template>
Change it to this in your customization layer:
<xsl:template match="indexentry">
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="primaryie"/>
</xsl:template>
I guess no one ever asked to cross reference between index entries before.
It's a bit unusual to write the index by hand using <indexentry> elements,
when the stylesheet can generate the index from <indexterm> elements
embedded in your document. Are you doing it this way so you can hot link
between index entries? I don't see how your entries link into the body of
the text, though.
Hot linking see and seealso entries is not currently a stylesheet feature,
but it seems like it would be a good one. You could file a request for such
on the DocBook SourceForge site if you want that feature in the stylesheets.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
----- Original Message -----
From: "Ilana Kingsley" <kingsley@arsc.edu>
To: <docbook-apps@lists.oasis-open.org>
Sent: Monday, May 10, 2004 12:29 PM
Subject: [docbook-apps] xref within index
> Hi All,
>
> I'm trying to use xref within an index so that the xref points to another
> entry within the index. The problem is the anchor tag never gets created
> in the xhtml. I'm using docbook-xsl-1.65.1.
>
> Here's example code:
>
> <index>
> <title>Index Title</title>
> <indexdiv><title>A</title>
> <indexentry><primaryie>APR</primaryie>
> <seeie><emphasis role="italic">See</emphasis>
> <xref linkend="a1001"/></seeie>
> </indexentry>
> <indexentry id="a1001" xreflabel="Alaska & Polar Regions">
> <primaryie>Alaska & Polar Regions</primaryie>
> </indexentry>
> </indexdiv>
> </index>
>
> The outout after the transform is:
>
> {snip...}
>
> <dt>Alaska & Polar Regions</dt> /* notice the id isn't output
>
> <dt>APR</dt>
> <dd><dl><dt><span class="italic">See</span> <a
> href="ix01.html#a1001">Alaska & Polar Regions</a></dt></dl></dd>
> <dt>
>
> So, do I need to customize my xsl files? If so, should it be index.xsl or
> xref.xsl?
>
> TIA,
>
> Ilana Kingsley, Web Librarian
> University of Alaska Fairbanks, Elmer E. Rasmuson Library
> 310 Tanana Drive,Room 449, Fairbanks, Alaska 997755
> Tel: 907-474-7518
> kingsley@arsc.edu || ffimk@uaf.edu
>
> To unsubscribe from this list, send a post to
docbook-apps-unsubscribe@lists.oasis-open.org, or visit
http://www.oasis-open.org/mlmanage/.
>
>
>
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.