[xep-support] Military Page Numbering

Loren Fieldhouse Loren.Fieldhouse at Halliburton.com
Thu Oct 5 13:31:51 PDT 2006


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 at 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



More information about the Xep-support mailing list