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

RE: [XSL-FO] chapter numbering

Expand Messages
  • Norma Yeazell
    This is a follow-up to my earlier question. I have the chapters numbering correctly now, but would like the page numbers to restart with each dmodule within
    Message 1 of 6 , Aug 24, 2004
    • 0 Attachment
      This is a follow-up to my earlier question. I have the chapters
      numbering correctly now, but would like the page numbers to restart with
      each dmodule within the chapter. I assume I need a new page sequence to
      accomplish this but I do not understand how to make this work. If I
      repeat the sequence I get the entire document again.

      When I started this we were just printing one dmodule at a time and
      everything worked fine but we have added the wrapper tags pm and chapter
      to put the book together.

      My xml would look like:

      <pm>
      <chapter>
      <dmodule> content A</dmodule>
      <dmodule> content A</dmodule>
      <dmodule> content A</dmodule>
      </chapter>
      <chapter>
      <dmodule> content B</dmodule>
      <dmodule> content B</dmodule>
      <dmodule> content B</dmodule>
      </chapter>
      </pm>

      <xsl:template match="/">
      <fo:root>
      <fo:layout-master-set>
      <fo:simple-page-master master-name="firstpage" page-height="297mm"
      page-width="210mm" margin-top="11mm" margin-bottom="12mm"
      margin-left="25mm" margin-right="15mm">
      <fo:region-body margin-top="21mm" margin-bottom="22mm"/>
      <fo:region-before extent="28mm" display-align="before"/>
      <fo:region-after region-name="first" extent="29mm"
      display-align="after"/>
      </fo:simple-page-master>

      <fo:simple-page-master master-name="restpage" page-height="297mm"
      page-width="210mm" margin-top="11mm" margin-bottom="12mm"
      margin-left="25mm" margin-right="15mm">
      <fo:region-body margin-top="21mm" margin-bottom="22mm"/>
      <fo:region-before extent="28mm" display-align="before"/>
      <fo:region-after region-name="rest" extent="29mm"
      display-align="after"/>
      </fo:simple-page-master>

      <fo:simple-page-master master-name="lastpage" page-height="297mm"
      page-width="210mm" margin-top="11mm" margin-bottom="12mm"
      margin-left="25mm" margin-right="15mm">
      <fo:region-body margin-top="21mm" margin-bottom="22mm"/>
      <fo:region-before extent="28mm" display-align="before"/>
      <fo:region-after region-name="last" extent="29mm"
      display-align="after"/>
      </fo:simple-page-master>

      <fo:page-sequence-master master-name="chapter">
      <fo:repeatable-page-master-alternatives>
      <fo:conditional-page-master-reference page-position="last"
      master-reference="lastpage"/>
      <fo:conditional-page-master-reference page-position="rest"
      master-reference="restpage"/>
      <fo:conditional-page-master-reference page-position="first"
      master-reference="firstpage"/>
      </fo:repeatable-page-master-alternatives>
      </fo:page-sequence-master>

      </fo:layout-master-set>

      <fo:page-sequence master-reference="chapter" language="en"
      line-height="1.15em" font-family="sans-serif" font-size="10pt"
      hyphenate="true">
      <fo:static-content flow-name="xsl-region-before">
      <fo:block font-weight="bold"
      text-align-last="justify"><fo:external-graphic content-width="1cm"
      src="Logo.tif"/><fo:leader leader-pattern="space"/>
      <xsl:text>Publication Number</xsl:text>
      </fo:block>
      <fo:block border-after-style="solid" border-after-width="0.5pt"
      space-before="1mm"/>
      <fo:block-container display-align="after"
      block-progression-dimension="15%">
      <fo:block font-size="10pt">
      <fo:retrieve-marker retrieve-class-name="issue-table-header"
      retrieve-position="first-starting-within-page"/>
      </fo:block>
      </fo:block-container>
      </fo:static-content>

      <fo:static-content flow-name="first" region-name="first">
      <fo:block border-before-style="solid" border-before-width="0.5pt"
      space-after="2mm"/>
      <fo:block text-align-last="justify">Effectivity: ALL<fo:leader
      leader-pattern="space"/><fo:wrapper font-weight="bold"><xsl:value-of
      select="dmno"/></fo:wrapper></fo:block>
      <fo:block text-align="right" font-weight="bold">
      <fo:retrieve-marker retrieve-class-name="issue-chap-number"
      retrieve-position="last-starting-within-page"/>
      </fo:block>
      <fo:block text-align="right" font-weight="bold">DRAFT
      COPY<fo:leader leader-pattern="space" leader-length="20%"/> Page
      <fo:page-number/></fo:block> </fo:static-content>

      <fo:static-content flow-name="last" region-name="last">
      <fo:block border-before-style="solid" border-before-width="0.5pt"
      space-after="2mm"/>
      <fo:block text-align-last="justify">Effectivity: ALL<fo:leader
      leader-pattern="space"/><fo:wrapper font-weight="bold"><xsl:value-of
      select="dmno"/></fo:wrapper></fo:block>
      <fo:block text-align="right" font-weight="bold">End of
      data<fo:leader leader-pattern="space" leader-length="30%"/>
      <fo:retrieve-marker retrieve-class-name="issue-chap-number"
      retrieve-position="last-starting-within-page"/>
      </fo:block>

      </fo:block>
      <fo:block text-align="right" font-weight="bold">DRAFT COPY Page
      <fo:page-number/></fo:block> </fo:static-content>

      <fo:static-content flow-name="rest" region-name="rest">
      <fo:block border-before-style="solid" border-before-width="0.5pt"
      space-after="2mm"/>
      <fo:block text-align-last="justify">Effectivity: ALL<fo:leader
      leader-pattern="space"/><fo:wrapper font-weight="bold"><xsl:value-of
      select="dmno"/></fo:wrapper></fo:block>
      <fo:block text-align="right" font-weight="bold">
      <fo:retrieve-marker retrieve-class-name="issue-chap-number"
      retrieve-position="last-starting-within-page"/>
      </fo:block>
      <fo:block text-align="right" font-weight="bold">DRAFT COPY Page
      <fo:page-number/></fo:block> </fo:static-content>

      <fo:flow flow-name="xsl-region-body"> <fo:marker
      marker-class-name="issue-table-header"/>
      <xsl:apply-templates/>
      </fo:flow>

      </fo:page-sequence>

      </fo:root>
      </xsl:template>



      Confidentiality Notice
      The information contained in this e-mail is confidential and intended for use only by the person(s) or organization listed in the address. If you have received this communication in error, please contact the sender at O'Neil & Associates, Inc., immediately. Any copying, dissemination, or distribution of this communication, other than by the intended recipient, is strictly prohibited.
    • G. Ken Holman
      ... Your stylesheet would be better structured like: ...
      Message 2 of 6 , Aug 24, 2004
      • 0 Attachment
        At 2004-08-24 09:34 -0400, Norma Yeazell wrote:
        >This is a follow-up to my earlier question. I have the chapters
        >numbering correctly now, but would like the page numbers to restart with
        >each dmodule within the chapter. I assume I need a new page sequence to
        >accomplish this but I do not understand how to make this work. If I
        >repeat the sequence I get the entire document again.
        >
        >When I started this we were just printing one dmodule at a time and
        >everything worked fine but we have added the wrapper tags pm and chapter
        >to put the book together.
        >
        >My xml would look like:
        >
        ><pm>
        ><chapter>
        ><dmodule> content A</dmodule>
        ><dmodule> content A</dmodule>
        ><dmodule> content A</dmodule>
        ></chapter>
        ><chapter>
        ><dmodule> content B</dmodule>
        ><dmodule> content B</dmodule>
        ><dmodule> content B</dmodule>
        ></chapter>
        ></pm>

        Your stylesheet would be better structured like:

        <xsl:template match="pm">
        <!--do root stuff-->
        <fo:root>
        <fo:layout-master-set>
        ...
        </fo:layout-master-set>
        <xsl:apply-templates select="chapter"/>
        </fo:root>
        </xsl:template>

        <xsl:template match="chapter">
        <!--do chapter stuff-->
        <xsl:apply-templates select="dmodule"/>
        </xsl:template>

        <xsl:template match="dmodule">
        <!--do module stuff-->
        <fo:page-sequence initial-page-number="1" ...>
        <!--do module content-->
        </fo:page-sequence>
        </xsl:template>

        ><xsl:template match="/">

        Your code appears to be trying to do *everything* inside of the processing
        of the root node ... my gut feel is that a modular approach will solve your
        problems.

        I hope this helps.

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

        --
        World-wide on-site corporate, govt. & user group XML/XSL 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 Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
        Legal business disclaimers: http://www.CraneSoftwrights.com/legal
      • Norma Yeazell
        Thanks again Ken that did the trick ... From: G. Ken Holman [mailto:gkholman@cranesoftwrights.com] Sent: Tuesday, August 24, 2004 9:53 AM To:
        Message 3 of 6 , Aug 24, 2004
        • 0 Attachment
          Thanks again Ken that did the trick

          -----Original Message-----
          From: G. Ken Holman [mailto:gkholman@...]
          Sent: Tuesday, August 24, 2004 9:53 AM
          To: XSL-FO@yahoogroups.com
          Subject: RE: [XSL-FO] chapter numbering

          At 2004-08-24 09:34 -0400, Norma Yeazell wrote:
          >This is a follow-up to my earlier question. I have the chapters
          >numbering correctly now, but would like the page numbers to restart
          with
          >each dmodule within the chapter. I assume I need a new page sequence to
          >accomplish this but I do not understand how to make this work. If I
          >repeat the sequence I get the entire document again.
          >
          >When I started this we were just printing one dmodule at a time and
          >everything worked fine but we have added the wrapper tags pm and
          chapter
          >to put the book together.
          >
          >My xml would look like:
          >
          ><pm>
          ><chapter>
          ><dmodule> content A</dmodule>
          ><dmodule> content A</dmodule>
          ><dmodule> content A</dmodule>
          ></chapter>
          ><chapter>
          ><dmodule> content B</dmodule>
          ><dmodule> content B</dmodule>
          ><dmodule> content B</dmodule>
          ></chapter>
          ></pm>

          Your stylesheet would be better structured like:

          <xsl:template match="pm">
          <!--do root stuff-->
          <fo:root>
          <fo:layout-master-set>
          ...
          </fo:layout-master-set>
          <xsl:apply-templates select="chapter"/>
          </fo:root>
          </xsl:template>

          <xsl:template match="chapter">
          <!--do chapter stuff-->
          <xsl:apply-templates select="dmodule"/>
          </xsl:template>

          <xsl:template match="dmodule">
          <!--do module stuff-->
          <fo:page-sequence initial-page-number="1" ...>
          <!--do module content-->
          </fo:page-sequence>
          </xsl:template>

          ><xsl:template match="/">

          Your code appears to be trying to do *everything* inside of the
          processing
          of the root node ... my gut feel is that a modular approach will solve
          your
          problems.

          I hope this helps.

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

          --
          World-wide on-site corporate, govt. & user group XML/XSL 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 Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
          Legal business disclaimers: http://www.CraneSoftwrights.com/legal





          Yahoo! Groups Links









          Confidentiality Notice
          The information contained in this e-mail is confidential and intended for use only by the person(s) or organization listed in the address. If you have received this communication in error, please contact the sender at O'Neil & Associates, Inc., immediately. Any copying, dissemination, or distribution of this communication, other than by the intended recipient, is strictly prohibited.
        Your message has been successfully submitted and would be delivered to recipients shortly.