I do something similar with <database> for schema reference docs...add
indexterms and hyperlinks where appropriate to the reference section.
Saves a LOT of manual tagging :-)
David
> -----Original Message-----
> From: Rasmus Kaj [mailto:]
> Sent: Tuesday, April 22, 2008 7:41 AM
> To:
> Subject: [docbook] firstterm and indexterm
>
> Hi DocBook community!
>
> When I use a <firstterm>, I generally want that term to end
> up in the index. So I generally write something like:
>
>
> <firstterm><indexterm><primary>foo</primary></indexterm>foo</f
irstterm>
>
> (Sometimes I've put the indexterm after or before the
> firstterm instead, but I think this is the best placement.)
>
> This obviously gets rather long. So I think I will create a
> preprossesing xslt transform to translate
> <firstterm>foo</firstterm> to the above for me. The
> transform would work something:
>
> <xsl:template match="firstterm[indexterm]">
> <firstterm>
> <xsl:apply-templates/><!-- pass through -->
> </firstterm>
> </xsl:template>
>
> <xsl:template match="firstterm[@baseform]">
> <firstterm>
> <indexterm><primary>
> <xsl:value-of select="@baseform"/>
> </primary></indexterm>
> <xsl:apply-templates/>
> </firstterm>
> </template>
>
> <xsl:template match="firstterm">
> <firstterm>
> <indexterm><primary>
> <xsl:value-of select="."/>
> </primary></indexterm>
> <xsl:apply-templates/>
> </firstterm>
> </template>
>
> <!-- and a copy-everything rule for all other stuff -->
>
> Would this be a good thing to do? Or would it be sematically
> bad in some way?
>
> --
> Rasmus Kaj <>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
>
>