xsl-list
[Top] [All Lists]

Re: Total number of pages with XSL-FO

2005-04-14 10:12:35

Well I tried and it does not work.  I suspect that it is because the id
'last-page' is in the actual .fo document, no in the xml.

here is a code snippet:

<xsl:choose>
      <xsl:when test="//fo:block/@id='last-page'">
            Page <fo:page-number/> of <fo:page-number-citation
ref-id="last-page"/>
      </xsl:when>
      <xsl:otherwise>
            Page 1 of 1
      </xsl:otherwise>
</xsl:choose>


<!--snip to block with id='last-page'-->

<fo:static-content flow-name="xsl-region-after-otherlast">
      <fo:block id="last-page" space-before="12pt"
keep-together.within-page="auto">
            <fo:leader leader-pattern="rule" leader-length="100%"
rule-thickness="0.5pt" rule-style="solid" color="black"/>
      </fo:block>
</fo:static-content>


Somehow, I think there is no way to get that xsl:choose to work.

I talked to the guy that worked on this before me.  The original stylesheet
had an empty block at the end of the document and that block had the id set
to "last-page".  The problem was that it cause a new empty page to be
displayed in some cases, and it was taken out.

My guess is that I am going to have to take it out and hope that the
custodians and users do not mind just having a page number, instead of the
total number of pages.

Nadia Swaby



                                                                                
                                             
                      JBryant(_at_)s-s-t(_dot_)co                               
                                                        
                      m                        To:      
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com                                
      
                                               cc:                              
                                             
                      2005-04-14 11:43         Subject: Re: [xsl] Total number 
of pages with XSL-FO                          
                      Please respond                                            
                                             
                      to xsl-list                                               
                                             
                                                                                
                                             
                                                                                
                                             




So here is my next question: is there any way to see if an id
exists in an FO document?

Nadia Swaby

Hi, Nadia,

Sure. You can do a test for it in either xsl:when or xsl:if. For example:

<xsl:if test="//@id='MyID'">
  <!-- Do something (perhaps apply certain templates) -->
</xsl:if>

Of course, if you can determine the exact path (not always possible
because elements may be nested at different depths and so on), you can use
the actual path instead of //.

HTH

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--