This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
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:
<!-- Identity copy --> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>
<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:call-template> </xsl:template>
<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"/> </xsl:call-template> </xsl:if> </xsl:template>
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 http://www.kosek.cz
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |