docbook-apps

  • 1.  get the total page of a document

    Posted 04-28-2010 05:09
    Hi,

    I want to have the total page of a document but this message was shown: "Unresolved id reference "last-page" found." I couldnt find  the way how to get first the last page. It would be nice if someone can help me to solve this problem?

    My code is like that:
    <fo:block>   
              <xsl:choose>
               
                    <xsl:when test="$double.sided = 0 and $position ='right'">
                                   <fo:page-number/>
                         <xsl:text> / </xsl:text>
                                     <fo:page-number-citation ref-id="last-page"/>
                                                               
                    </xsl:when>       
    ............................................................
    <xsl:template match="book/index|part/index">
             
           <fo:flow>
                      <xsl:variable name="id">
                               <xsl:call-template name="object.id"/>
                         </xsl:variable>
                           <fo:block id="{$id}">
                             <xsl:imports-templates/>
                               </fo:block>
                                                           
                     <fo:page-sequence>
                    
                        <xsl:if test="$id='last()'">
                       
                             <fo:block id="last-page"/>
                             
                          </xsl:if>

    I use fop v 0.95

               My regards!

             Solofo






  • 2.  RE: [docbook-apps] get the total page of a document

    Posted 04-28-2010 16:14
    | -----Original Message-----
    | From: rabarivelo solofo
    |
    | I want to have the total page of a document but this message
    | was shown: "Unresolved id reference "last-page" found." I
    | couldnt find the way how to get first the last page. It
    | would be nice if someone can help me to solve this problem?


    Here are some hints:
    http://www.sagehill.net/docbookxsl/PrintHeaders.html#Pagexofy
    http://xmlgraphics.apache.org/fop/fo.html#fo-total-pages.


    | <fo:block id="{$id}">
    | <xsl:imports-templates/>
    ^^^^^^^^^^^^^^^^^

    I have not tried to understand your stylesheet logic, but this can't be
    right. I guess that you really mean <xsl:apply-templates/> (or
    <xsl:apply-imports/>).

    Mauritz