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] Permuted Index, may be OT

Riaan Bredenkamp wrote:

> Say "The fat cat sleeps." is a term I want to create list in an index.
> in a normal index there would be one entry :
> T
> "The fat cat sleeps." -- 15

And currenty you have marked this term as <indexterm><primary>The fat
cat sleeps</primary></indexterm>?

> In a permuted index there would be multiple entries:
> C
> cat - the fat sleeps. -- 15
> F
> fat - the cat sleeps. -- 15
> S
> sleeps - the fat cat. -- 15
> T
> The - fat cat sleeps. -- 15

If so, you can create preprocessing step which will create seperate
indexterms for each word. Something like:

<xsl:stylesheet ...>

<!-- Identity copy -->
<xsl:template match="@*|node()">
       <xsl:apply-templates select="@*|node()"/>

<xsl:template match="indexterm">
    <!-- Duplicate current indexterm -->
    <xsl:copy-of select="."/>
    <!-- Create permutations -->
    <xsl:call-template name="perm">
      <xsl:with-param name="text" select="string(primary)"/>

<xsl:template name="perm">
    <xsl:param name="text"/>
    <xsl:variable name="first" select="substring-before(concat($text, '
'), ' ')"/>
    <xsl:variable name="rest" select="substring-after($text, ' ')"/>


    <xsl:if test="$rest != ''">
      <xsl:call-template name="perm">
        <xsl:with-param name="text" select="$rest"/>


Then you will apply this stylesheet to your DocBook document to get
temporary DocBook document with index permutations. You will then
process this temporary document as normal DocBook document.

    Jirka Kosek  	
    e-mail: jirka@kosek.cz

S/MIME Cryptographic Signature

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