This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: Re: Auto Index in FO stylesheets
- From: Bob Stayton <bobs at caldera dot com>
- To: Norman Walsh <ndw at nwalsh dot com>
- Cc: Bob Stayton <bobs at caldera dot com>, Jeff Beal <jeff dot beal at ansys dot com>,"DocBook Mailing List (E-mail)" <docbook-apps at lists dot oasis-open dot org>
- Date: Fri, 03 Jan 2003 02:33:38 -0800
- Subject: Re: DOCBOOK-APPS: Re: Auto Index in FO stylesheets
- References: <E08C8F26F6901D42B1201763D125853815B38A@ntdevexc.win.ansys.com><20021209132620.F19510@caldera.com> <20021212142556.F11649@caldera.com><87d6ng8vyk.fsf@nwalsh.com>
On Wed, Jan 01, 2003 at 03:18:59PM -0500, Norman Walsh wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> / Bob Stayton <bobs@caldera.com> was heard to say:
> | On Mon, Dec 09, 2002 at 01:26:20PM -0800, Bob Stayton wrote:
> |> On Mon, Dec 09, 2002 at 03:46:47PM -0500, Jeff Beal wrote:
> |> > I just tried to automatically generate an index at the end of a book using
> |> > the DocBook 1.57.0 stylesheets and XEP. I found that the generate.index
> |> > parameter did nothing unless I had an empty <index/> tag at the end of the
> |> > book, and that the index then contained the index for the entire set.
> |
> | I just checked in the changes to fix this problem.
> | Now an automatically generated index uses only those
> | indexterms that are ancestors of the empty index element's
> | parent. So a setindex will have indexterms from the
> | whole set, while each book's index will have only entries
> | for that book. You can have indexes per chapter
> | or section, if you want.
>
> What about the case where I have a book in <part>s?
>
> I tinkered with this code a bit (and added support for setindex in the
> FO case) so that <index> always indexes the book it's in. Setindex
> always indexes the *whole* document.
>
> I just don't think indexing from the parent of index makes much sense
> and it completely breaks for books that have parts.
Well, it breaks only if you put your <index/> in a part rather than
after all the parts in your book. 8^)
But you are right that the logical scope for an index is
the whole document, unless it is a book in a set, in which
case an index is for a book. We have setindex for
the set, since you fixed setindex.
But autoidx.xsl in 1.59.0 is not quite done still.
Although you pass $root as a parameter to generate-index to
indicate the scope, it isn't propagated down through the
index processing. The $terms variable is only used to get
the first term of each letter used. The other templates
make new selections using the various keys already set up.
The $scope variable I set up in the fo version of
the generate-index template is doing exactly what you
want, and it is passed down as a parameter to the other
templates. If you don't mind, I'll change $root to
$scope (keeping the selection that you set up),
and adapt it to the HTML autoidx.xsl as well.
With scope as a parameter to generate-index, it would be
easy for someone to customize the scope of an index
beyond the default behavior.
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@sco.com