RE: [xep-support] Military Page Numbering

From: Peter Kester <peter.kester@daidalos.nl>
Date: Mon Oct 09 2006 - 00:53:18 PDT

Hi Loren,

If you want your chapters to start numbering from page 1 you have to put
your chapters into separate page-sequences and give those page-sequences
an initial-page-number attribute of value '1'. Then you have to put your
chapter number (generated or given) into a fo:marker

In your footer code (inside fo:page-sequence and before fo:flow) you use
something like this:
<fo:static-content flow-name="footer">
<fo:block ... some layout>
<fo:retrieve-marker retrieve-class-name="chapternr"/>-<fo:page-number>
</fo:block>
</fo:static-content>

And to solve the problem of your TOC you only have to stick in the
chapternr right before your page-number-citation
Something like this:
<fo:leader leader-pattern="dots" leader-pattern-width="4pt"/>
<xsl:value-of select="ancestor::chapter[1]/nr<fo:page-number-citation
ref-id="{generate-id()}" />

regards,

Peter

   
 
Ing. P.A. Kester
Senior Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984

De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
 

Van: owner-xep-support@renderx.com
[mailto:owner-xep-support@renderx.com] Namens Loren Fieldhouse
Verzonden: donderdag 5 oktober 2006 22:32
Aan: xep-support@renderx.com
Onderwerp: [xep-support] Military Page Numbering

I am attempting to implement a military numbering style into the
documentation that I have to produce. I haven't seen this done
elsewhere, so I am hoping that this can be done.

Here's what I need:

I have an XSL stylesheet that refers to multiple XML files. Each file is
it's own chapter. What I need to do is have my XSL stylesheet generate
page counts like this:

Chapter Number-Page Number

I also need to have the Chapter Number-Page Number working in the
generated table of contents.

Here is what I have:

<fo:root>
            <!-- TOC -->
            <fo:page-sequence master-reference="toc"
initial-page-number="1" format="i" force-page-count="no-force">
                    <fo:flow flow-name="xsl-region-body">
                        <fo:block>
                            <fo:inline>Table of Contents</fo:inline>
                        </fo:block>
                        <fo:block font-family="Arial" font-size="10pt">
                            <xsl:for-each
select="document('index.xml')/book/includes/file">
                                <xsl:for-each
select="document(concat(.,'.xml'))/chapter//title |
 
document(concat(.,'.xml'))/chapter//heading1 |
 
document(concat(.,'.xml'))/chapter//heading2 |
 
document(concat(.,'.xml'))/chapter//heading3 |
 
document(concat(.,'.xml'))/chapter//heading4">
                                    <fo:block>
                                        <fo:basic-link>
                                            <xsl:attribute
name="internal-destination">
                                                <xsl:choose>
                                                    <xsl:when
test="@id">
                                                        <xsl:value-of
select="@id"/>
                                                    </xsl:when>
                                                    <xsl:when
test="name(preceding-sibling::*[1]) = 'a' and
preceding-sibling::*[1]/@name">
                                                        <xsl:value-of
select="preceding-sibling::*[1]/@name"/>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <xsl:value-of
select="generate-id()"/>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </xsl:attribute>
                                            <xsl:apply-templates
select="*|text()"/>
                                            <fo:leader
leader-pattern="dots" leader-pattern-width="4pt"/>
                                            <fo:page-number-citation
ref-id="{generate-id()}" />
                                        </fo:basic-link>
                                    </fo:block>
                                </xsl:for-each>
                            </xsl:for-each>
                        </fo:block>
                    </fo:flow>
            </fo:page-sequence>
            
            <!-- Book Pages -->
                <fo:page-sequence master-reference="default-page"
initial-page-number="1" format="1">

                    <!-- Footer Contents -->
                    <fo:static-content flow-name="xsl-region-after">
                        <fo:block>
                            <fo:inline><!-- Need to have the Chapter
Number-Page Number information here --></fo:inline>
                        </fo:block>
                    </fo:static-content>
                    <fo:flow flow-name="xsl-region-body">
                        <fo:block font-family="Arial" font-size="10pt">
                            <xsl:for-each select="/book/includes/file">
                                <xsl:apply-templates
select="document(concat(.,'.xml'))/chapter"/>

                            </xsl:for-each>
                        </fo:block>
                    </fo:flow>
                </fo:page-sequence>
    </fo:root>
    
    </xsl:template>
    <xsl:template match="chapter">
        <xsl:apply-templates />
    </xsl:template>
 
<xsl:template match="heading1">
    <fo:block id="{generate-id()}">
        <xsl:apply-templates />
    </fo:block>
</xsl:template>
    
<xsl:template match="heading2">
    <fo:block id="{generate-id()}">
        <xsl:apply-templates />
    </fo:block>
</xsl:template>

<xsl:template match="heading3">
    <fo:block id="{generate-id()}">
        <xsl:apply-templates />
    </fo:block>
</xsl:template>

<xsl:template match="heading4">
    <fo:block id="{generate-id()}">
        <xsl:apply-templates />
    </fo:block>
</xsl:template>

 

<xsl:template match="title">
    <fo:block id="{generate-id()}">
        <xsl:apply-templates/>
    </fo:block>
</xsl:template>

Any help is greatly appreciated.

Thanks,
Loren Fieldhouse
----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and
privileged information for the sole use of the intended recipient. Any
review, use, distribution, or disclosure by others is strictly
prohibited. If you are not the intended recipient (or authorized to
receive information for the intended recipient), please contact the
sender by reply e-mail and delete all copies of this message.

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
http://www.renderx.com/terms-of-service.html

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Mon Oct 9 00:53:57 2006

This archive was generated by hypermail 2.1.8 : Mon Oct 09 2006 - 00:53:57 PDT