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

Dynamically numbering pages in XSLFO

Expand Messages
  • mina_hurray
    Hi: Is there a way to dynamically number pages in XSLFO? Suppose I have an xml: If there is an image, then
    Message 1 of 5 , Apr 24, 2007
    • 0 Attachment
      Hi:

      Is there a way to dynamically number pages in XSLFO?

      Suppose I have an xml:

      <root>
      <...some element...>

      <image></image>

      </root>

      If there is an image, then a page should be accounted for the image.
      So if we had 3 pages and an image was added total number of pages
      should now be 4 pages. If it was removed, then pages shuld be 3. Can
      this be done in XSLFO?

      Please advice.
    • G. Ken Holman
      ... Only by you triggering actual blank pages in the output that then get removed/replaced ... you cannot do arithmetic with page numbers. I m assuming by
      Message 2 of 5 , Apr 24, 2007
      • 0 Attachment
        At 2007-04-24 23:26 +0000, mina_hurray wrote:
        >Is there a way to dynamically number pages in XSLFO?
        >
        >Suppose I have an xml:
        >
        ><root>
        ><...some element...>
        >
        ><image></image>
        >
        ></root>
        >
        >If there is an image, then a page should be accounted for the image.
        >So if we had 3 pages and an image was added total number of pages
        >should now be 4 pages. If it was removed, then pages shuld be 3. Can
        >this be done in XSLFO?

        Only by you triggering actual blank pages in the output that then get
        removed/replaced ... you cannot do arithmetic with page numbers. I'm
        assuming by your description that the image is a page on its own.

        You can set an arbitrary page number for the first page of a page
        sequence, but the problem is you cannot calculate what page number to
        use for the first page of the following page sequence.

        I hope this helps.

        . . . . . . . . . . . Ken

        --
        World-wide corporate, govt. & user group XML, XSL and UBL training
        RSS feeds: publicly-available developer resources and training
        G. Ken Holman mailto:gkholman@...
        Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
        Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
        Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/f/bc
        Legal business disclaimers: http://www.CraneSoftwrights.com/legal
      • ms
        Thank you for your response. Does that mean that XSLFO does not allow numbering pages dynamically? Is there any way to fo it using different page sequences?
        Message 3 of 5 , Apr 24, 2007
        • 0 Attachment
          Thank you for your response. Does that mean that XSLFO
          does not allow numbering pages dynamically? Is there
          any way to fo it using different page sequences?


          --- "G. Ken Holman" <gkholman@...>
          wrote:

          > At 2007-04-24 23:26 +0000, mina_hurray wrote:
          > >Is there a way to dynamically number pages in
          > XSLFO?
          > >
          > >Suppose I have an xml:
          > >
          > ><root>
          > ><...some element...>
          > >
          > ><image></image>
          > >
          > ></root>
          > >
          > >If there is an image, then a page should be
          > accounted for the image.
          > >So if we had 3 pages and an image was added total
          > number of pages
          > >should now be 4 pages. If it was removed, then
          > pages shuld be 3. Can
          > >this be done in XSLFO?
          >
          > Only by you triggering actual blank pages in the
          > output that then get
          > removed/replaced ... you cannot do arithmetic with
          > page numbers. I'm
          > assuming by your description that the image is a
          > page on its own.
          >
          > You can set an arbitrary page number for the first
          > page of a page
          > sequence, but the problem is you cannot calculate
          > what page number to
          > use for the first page of the following page
          > sequence.
          >
          > I hope this helps.
          >
          > . . . . . . . . . . . Ken
          >
          > --
          > World-wide corporate, govt. & user group XML, XSL
          > and UBL training
          > RSS feeds: publicly-available developer
          > resources and training
          > G. Ken Holman
          > mailto:gkholman@...
          > Crane Softwrights Ltd.
          > http://www.CraneSoftwrights.com/f/
          > Box 266, Kars, Ontario CANADA K0A-2E0
          > +1(613)489-0999 (F:-0995)
          > Male Cancer Awareness Aug'05
          > http://www.CraneSoftwrights.com/f/bc
          > Legal business disclaimers:
          > http://www.CraneSoftwrights.com/legal
          >
          >


          __________________________________________________
          Do You Yahoo!?
          Tired of spam? Yahoo! Mail has the best spam protection around
          http://mail.yahoo.com
        • G. Ken Holman
          ... Twice now you ve used the word dynamically so I suppose I do not understand what you are saying. In your example, you cited that the presence or absence
          Message 4 of 5 , Apr 24, 2007
          • 0 Attachment
            At 2007-04-24 17:01 -0700, you wrote:
            >Thank you for your response. Does that mean that XSLFO
            >does not allow numbering pages dynamically?

            Twice now you've used the word "dynamically" so I suppose I do not
            understand what you are saying.

            In your example, you cited that the presence or absence of an <image>
            element is supposed to add or not add another page to the page
            number. I responded that you create the page yourself in the output
            in order to influence the page number and then replace the page with
            your image page.

            XSL-FO counts the pages you create ... full stop ... you cannot do
            arithmetic with page numbers. To me, creating page numbers for pages
            needed is creating "dynamic" page numbers ... I suppose that isn't
            how you are using the word.

            >Is there any way to fo it using different page sequences?

            Anticipating that question I also stated you cannot use multiple page
            sequences because you cannot calculate which page number to use for a
            subsequent page sequence after the page with the image.

            So I'm not sure what you are asking ... I apologize that I cannot help you.

            . . . . . . . . . Ken

            >--- "G. Ken Holman" <gkholman@...>
            >wrote:
            >
            > > At 2007-04-24 23:26 +0000, mina_hurray wrote:
            > > >Is there a way to dynamically number pages in
            > > XSLFO?
            > > >
            > > >Suppose I have an xml:
            > > >
            > > ><root>
            > > ><...some element...>
            > > >
            > > ><image></image>
            > > >
            > > ></root>
            > > >
            > > >If there is an image, then a page should be
            > > accounted for the image.
            > > >So if we had 3 pages and an image was added total
            > > number of pages
            > > >should now be 4 pages. If it was removed, then
            > > pages shuld be 3. Can
            > > >this be done in XSLFO?
            > >
            > > Only by you triggering actual blank pages in the
            > > output that then get
            > > removed/replaced ... you cannot do arithmetic with
            > > page numbers. I'm
            > > assuming by your description that the image is a
            > > page on its own.
            > >
            > > You can set an arbitrary page number for the first
            > > page of a page
            > > sequence, but the problem is you cannot calculate
            > > what page number to
            > > use for the first page of the following page
            > > sequence.
            > >
            > > I hope this helps.
            > >
            > > . . . . . . . . . . . Ken


            --
            World-wide corporate, govt. & user group XML, XSL and UBL training
            RSS feeds: publicly-available developer resources and training
            G. Ken Holman mailto:gkholman@...
            Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
            Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
            Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/f/bc
            Legal business disclaimers: http://www.CraneSoftwrights.com/legal
          • mina_hurray
            Hello Mr.Holman: I did understand your answers. I apologize for repeating my questions, but they were just to clarify to make sure I understood what you were
            Message 5 of 5 , Apr 25, 2007
            • 0 Attachment
              Hello Mr.Holman:

              I did understand your answers. I apologize for repeating my questions,
              but they were just to clarify to make sure I understood what you were
              saying. Thanks a lot for all your help as always.







              --- In XSL-FO@yahoogroups.com, "G. Ken Holman" <gkholman@...> wrote:
              >
              > At 2007-04-24 17:01 -0700, you wrote:
              > >Thank you for your response. Does that mean that XSLFO
              > >does not allow numbering pages dynamically?
              >
              > Twice now you've used the word "dynamically" so I suppose I do not
              > understand what you are saying.
              >
              > In your example, you cited that the presence or absence of an <image>
              > element is supposed to add or not add another page to the page
              > number. I responded that you create the page yourself in the output
              > in order to influence the page number and then replace the page with
              > your image page.
              >
              > XSL-FO counts the pages you create ... full stop ... you cannot do
              > arithmetic with page numbers. To me, creating page numbers for pages
              > needed is creating "dynamic" page numbers ... I suppose that isn't
              > how you are using the word.
              >
              > >Is there any way to fo it using different page sequences?
              >
              > Anticipating that question I also stated you cannot use multiple page
              > sequences because you cannot calculate which page number to use for a
              > subsequent page sequence after the page with the image.
              >
              > So I'm not sure what you are asking ... I apologize that I cannot
              help you.
              >
              > . . . . . . . . . Ken
              >
              > >--- "G. Ken Holman" <gkholman@...>
              > >wrote:
              > >
              > > > At 2007-04-24 23:26 +0000, mina_hurray wrote:
              > > > >Is there a way to dynamically number pages in
              > > > XSLFO?
              > > > >
              > > > >Suppose I have an xml:
              > > > >
              > > > ><root>
              > > > ><...some element...>
              > > > >
              > > > ><image></image>
              > > > >
              > > > ></root>
              > > > >
              > > > >If there is an image, then a page should be
              > > > accounted for the image.
              > > > >So if we had 3 pages and an image was added total
              > > > number of pages
              > > > >should now be 4 pages. If it was removed, then
              > > > pages shuld be 3. Can
              > > > >this be done in XSLFO?
              > > >
              > > > Only by you triggering actual blank pages in the
              > > > output that then get
              > > > removed/replaced ... you cannot do arithmetic with
              > > > page numbers. I'm
              > > > assuming by your description that the image is a
              > > > page on its own.
              > > >
              > > > You can set an arbitrary page number for the first
              > > > page of a page
              > > > sequence, but the problem is you cannot calculate
              > > > what page number to
              > > > use for the first page of the following page
              > > > sequence.
              > > >
              > > > I hope this helps.
              > > >
              > > > . . . . . . . . . . . Ken
              >
              >
              > --
              > World-wide corporate, govt. & user group XML, XSL and UBL training
              > RSS feeds: publicly-available developer resources and training
              > G. Ken Holman mailto:gkholman@...
              > Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
              > Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
              > Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/f/bc
              > Legal business disclaimers: http://www.CraneSoftwrights.com/legal
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.