Page citation in PDF

13 views
Skip to first unread message

Julio Vazquez

unread,
Jan 26, 2015, 4:21:20 PM1/26/15
to dita-o...@googlegroups.com
I'm trying to build a type of TOC on the front cover of a document. What's frustrating is that I had this working before Christmas and then wound up breaking it fixing other things. (D'OH!)

In any case, I have a for-each with this select="//*[contains(@class,' bookmap/chapter ')]". What I want to do is a page-citation to the first topic in the chapter (there's no href on the Chapter element). Just specifying @id or ./@id gets me the page number of the cover page. I've tried child::*[contains,(@class,' topic/topic ')][1]/@id and that came up empty.

Here are the snippets involved. Can someone give me an idea of where I'm awry?

<xsl:for-each select="//*[contains(@class,' bookmap/chapter ')]">                                   
                                <fo:table-row font-family="Sans" margin-right="25%">
                                    <fo:table-cell background-color="#9a9a9a" width=".375in" text-align="center"
                                        color="white" font-size="9pt" padding-top="9.5pt" padding-left="12pt">
                                        <fo:block line-height="9.5pt" start-indent="2pt">
                                            <xsl:call-template name="getLanguage">
                                                <xsl:with-param name="thisLang" select="@xml:lang"/>
                                            </xsl:call-template>
                                        </fo:block>
                                        <fo:block line-height="9.5pt"  start-indent="2pt">
                                            <fo:page-number-citation>
                                                <xsl:attribute name="ref-id">
                                                    <xsl:apply-templates mode="coverid"/>                     
                                                </xsl:attribute>
                                            </fo:page-number-citation>
                                        </fo:block>
                                    </fo:table-cell>

and the template invoked:

   <xsl:template mode="coverid" match="*">
        <xsl:message>[coverid] ID =
            <xsl:value-of select="./@id"/>
        </xsl:message>
        <xsl:value-of select="./@id"/>
    </xsl:template>

Thanks.

Julio
Reply all
Reply to author
Forward
0 new messages