Jump to content

index


ramu246

Recommended Posts

Hello every one,

 

 

I have generated an output in pdf using some style sheet. In index page, index items are displaying properly,but index page numbers are showing '0'. (see the attachment)

 

Here is my index section code..

 

<!-- # call-template | generate-index -->
<xsl:template name="generate-index">
<fo:block id="index" break-before="page" span="none">
<fo:block xsl:use-attribute-sets="bold font20" margin-bottom="14mm" span="none"
axf:outline-level="1">
<xsl:attribute name="axf:outline-title">
<xsl:value-of select="$index.str"/>
</xsl:attribute>
<xsl:value-of select="$index.str"/>
</fo:block>
<xsl:for-each select="//indexterm">
<xsl:sort select="normalize-space(.)" data-type="text" order="ascending"/>
<xsl:variable name="this" select="normalize-space(.)"/>
<xsl:variable name="this-pos" select="position()"/>
<xsl:variable name="before-pos" select="$this-pos - 1"/>
<xsl:variable name="this-first">
<xsl:call-template name="str:to-upper">
<xsl:with-param name="text" select="substring($this,1,1)"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="before-text">
<xsl:for-each select="//indexterm">
<xsl:sort select="normalize-space(.)" data-type="text" order="ascending"/>
<xsl:if test="position() = $before-pos">
<xsl:value-of select="normalize-space(.)"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="before-first">
<xsl:call-template name="str:to-upper">
<xsl:with-param name="text" select="substring($before-text,1,1)"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$this-pos = '1'">
<fo:block xsl:use-attribute-sets="bold font16" keep-with-next.within-column="always">
<xsl:value-of select="$this-first"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$this-first != $before-first">
<fo:block xsl:use-attribute-sets="bold font16" margin-top="5mm"
keep-with-next.within-column="always">
<xsl:value-of select="$this-first"/>
</fo:block>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="preceding::indexterm[normalize-space(.) = $this]">
<xsl:call-template name="index-item">
<xsl:with-param name="text">
<xsl:value-of select="$this"/>
</xsl:with-param>
<xsl:with-param name="duplicative">yes</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="index-item">
<xsl:with-param name="text">
<xsl:value-of select="$this"/>
</xsl:with-param>
<xsl:with-param name="duplicative">no</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</fo:block>
</xsl:template>

 

 

 

 

 

 

 

 

<!-- # call-template | index-item -->
<xsl:template name="index-item">
<xsl:param name="text"/>
<xsl:param name="duplicative"/>
<xsl:param name="this-string"/>
<xsl:if test="$text != '' and $duplicative != 'yes'">
<fo:block>
<fo:table border-style="none" width="72mm" xsl:use-attribute-sets="default font10"
margin-bottom="2mm">
<fo:table-column column-number="1" column-width="66mm"/>
<fo:table-column column-number="2" column-width="6mm"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell column-number="1" display-align="after" text-align="left">
<fo:block>
<xsl:value-of select="translate(substring(.,1,1),'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
<xsl:value-of select="substring(.,2)"/>
</fo:block>
</fo:table-cell>
<fo:table-cell column-number="2" text-align="right" display-align="after">
<fo:block text-align="right" keep-together.within-line="always">
<fo:page-number-citation axf:suppress-duplicate-page-number="true">
<xsl:attribute name="ref-id"><xsl:value-of select="generate-id()"/></xsl:attribute>
</fo:page-number-citation>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:if>
</xsl:template>
in second template, in page number citation, i have to select a value.but i don't know what to select. Please help me in this issue
thanks in advance

post-167434-0-30482800-1387342635_thumb.jpg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...