Loading ...
Sorry, an error occurred while loading the content.

Re: [XSL-FO] Re: Pagenumber

Expand Messages
  • Nikolai Grigoriev
    Hakan, ... Generate an empty termination block in each sequence, and refer to it. Use generate-id() to get a unique id, like this:
    Message 1 of 10 , Mar 1, 2001
    • 0 Attachment
      Hakan,

      > That means I create a new page-seq. for each item. Everything outputs
      > correct, but since my outer loop is outside the page-seq. I'm not
      > sure where to put the page-number-citation-id.

      Generate an empty termination block in each sequence, and refer to it. Use
      generate-id() to get a unique id, like this:

      <!-- For each IStartHoleTeeTimes object -->
      <xsl:for-each select="/root/coll/coll_Item">
      <!-- Get a unigue number -->
      <xsl:variable name="end-id"
      select="concat('terminator-', generate-id())"/>

      <fo:page-sequence master-name="simple"
      initial-page-number="1"
      force-page-count="no-force">
      <fo:static-content flow-name="xsl-region-before">
      <fo:block>
      Page <fo:page-number/>
      of <fo:page-number-citation ref-id="{$end-id}"/>
      </fo:block>
      </fo:static-content>
      <fo:flow flow-name="xsl-region-body">
      ..............
      <fo:block id="{$end-id}"/>
      </fo:flow>
      </fo:page-sequence>

      (I omitted all irrelevant fragments from your sample)

      I have put force-page-count="no-force" - this is normally used with simplex
      printing. Otherwise the formatter will complement page sequences to end at even
      pages - it's another cryptic feature of XSL FO :-).

      Regards,
      Nikolai
    • hakan.lindestaf@epani.com
      Sorry but this didn t work. If I have two main items in my collection and the total pages was 7 and the first main item generated 5 pages and the last one
      Message 2 of 10 , Mar 1, 2001
      • 0 Attachment
        Sorry but this didn't work. If I have two main items in my collection
        and the total pages was 7 and the first main item generated 5 pages
        and the last one generated 2 pages, the page x of y would be:
        Page 1 of 5
        Page 2 of 5
        Page 3 of 5
        Page 4 of 5
        Page 5 of 5
        Page 6 of 7
        Page 7 of 7

        But I found another way of doing this. I checked inside the page-seq.
        if I'm at the last main item in the main collection, and if I am then
        I create a dummy block with an id. It works for now, even though not
        the nicest solution.


        Thanks for all your help, I really really appreciate it!

        /Hakan



        --- In XSL-FO@y..., "Nikolai Grigoriev" <grig@r...> wrote:
        > Hakan,
        >
        > > That means I create a new page-seq. for each item. Everything
        outputs
        > > correct, but since my outer loop is outside the page-seq. I'm not
        > > sure where to put the page-number-citation-id.
        >
        > Generate an empty termination block in each sequence, and refer to
        it. Use
        > generate-id() to get a unique id, like this:
        >
        > <!-- For each IStartHoleTeeTimes object -->
        > <xsl:for-each select="/root/coll/coll_Item">
        > <!-- Get a unigue number -->
        > <xsl:variable name="end-id"
        > select="concat('terminator-', generate-id())"/>
        >
        > <fo:page-sequence master-name="simple"
        > initial-page-number="1"
        > force-page-count="no-force">
        > <fo:static-content flow-name="xsl-region-before">
        > <fo:block>
        > Page <fo:page-number/>
        > of <fo:page-number-citation ref-id="{$end-id}"/>
        > </fo:block>
        > </fo:static-content>
        > <fo:flow flow-name="xsl-region-body">
        > ..............
        > <fo:block id="{$end-id}"/>
        > </fo:flow>
        > </fo:page-sequence>
        >
        > (I omitted all irrelevant fragments from your sample)
        >
        > I have put force-page-count="no-force" - this is normally used
        with simplex
        > printing. Otherwise the formatter will complement page sequences to
        end at even
        > pages - it's another cryptic feature of XSL FO :-).
        >
        > Regards,
        > Nikolai
      Your message has been successfully submitted and would be delivered to recipients shortly.