Need to change the decimal page number into topic title abbreviation #DITA-OT #PDF


boopathyks@...
 

Hi,

I'm doing the dita-ot pdf conversion, using lot of topic dita template and requirement is to changing the decimal page numbers into the topic title abbreviation for one topic alone, other topic it should be in decimal page number only

In the commons.xsl

<xsl:template match="*[contains(@class, ' topic/topic ')]">

<xsl:when test="not(ancestor::*[contains(@class, ' topic/topic ')]) and not(ancestor::ot-placeholder:glossarylist)">
<fo:page-sequence master-reference="{$page-sequence-reference}" xsl:use-attribute-sets="__force__page__count" initial-page-number="1">
<xsl:call-template name="startPageNumbering"/>
</fo:page-sequence>
</xsl:when>


</xsl:template>

Commons-attr.xsl:

    <xsl:attribute-set name="__force__page__count">
        <xsl:attribute name="force-page-count">
            <xsl:choose>
                <xsl:when test="name(/*) = 'bookmap'">
                    <xsl:value-of select="'even'"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="'auto'"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:attribute>
    </xsl:attribute-set>
 

There is no any templates for startPageNumbering, as per the initial-page-number and force_page_count, decimal page number getting reset for every topic as starting with page number 1. So that I just want to change the one topic decimal page number into the corresponding topic title abbreviation

for eg:

<topic class="- topic/topic ">
<title class="- topic/title " outputclass="CD_Section_Heading">DEFINITIONS</title>
</topic>


for this DEFINITIONS topic page number should "DEF" as like that I have few topic that should get abbreviation as page number for that corresponding topic pages. Please help me and let me know if you need any more. Thanks in Advance!!!


stinakab
 

Hi,

You haven't mentioned which DITA OT version you're using but I guess this applies to all versions.
I think the page number is added with the static-content.xsl file. In there, there are templates for headers and footers where fo:page-number inserts the page number. I think the startPageNumbering template in the commons.xsl only allows you to enable start numbering on the first page of your document.
So maybe you could insert a conditional test in static-content.xsl and see if that works for you.

Best,
Christina


boopathyks@...
 

Thanks Christina, Its working fine as per your suggestion, but i'm having some issue to apply the changes for all the child topic, actually my input dita file having topics like this

<topic outputclass="h1">
   <title outputclass="CD_Map_Heading-hide">HIDE TOPIC</title>
   <topic outputclass="h2">
      <title>DEFINITION</title>
   </topic>
   <topic outputclass="h3">
      <title>REVOLUTION</title>
   </topic>
</topic>
static-content.xsl
<xsl:template name="insertBodyOddFooter">
    <fo:static-content flow-name="odd-body-footer">
        <fo:block>&#160;</fo:block>
        <fo:block xsl:use-attribute-sets="__body__odd__footer">
            <xsl:choose>
                <xsl:when test="contains(@outputclass, 'h2')">
                    <xsl:text>DEF</xsl:text>
</xsl:when>
<xsl:when test="contains(@outputclass, 'h3')">
                    <xsl:text>REV</xsl:text>
</xsl:when>
<xsl:otherwise> <fo:block-container position="absolute"> <fo:block padding-top="20pt" text-align="center"> <fo:page-number/> </fo:block> </fo:block-container> </xsl:otherwise> </xsl:choose> </fo:block> </fo:static-content> </xsl:template>

I'm getting only DEF as footnote for all the topics.But I need separate footnote for each child topic. For the h3 attribute I need to get REV as footer value. But I'm getting only DEF. So please help me to get the footer value for that corresponding chils topic pages. Thanks in advance!!!


stinakab
 

Hi,

I guess this has been resolved with the following Oxygen forum entry, correct? https://www.oxygenxml.com/forum/topic22984.html