Проблема с заголовком DITA в PDF

У меня есть dita XML со следующей структурой.

<bookmap>
<frontmatter><!-- FM content --></frontmatter>
<concept><!-- chapter  content --></concept>
<concept><!-- chapter  content --></concept>
<concept><!-- chapter  content --></concept>
<concept><!-- chapter  content --></concept>
<concept><!-- chapter  content --></concept>
<concept><!-- chapter  content --></concept>
<concept><!-- chapter  content --></concept>
<concept><!-- chapter  content --></concept>
</bookmap>

Мне нужно иметь другой заголовок только для первой страницы первого уровня, остальные нормальные.

Я использовал dita для pdf, добавляя статическое содержимое для первой страницы.

<fo:static-content flow-name="first-body-header">
        <fo:block xsl:use-attribute-sets="__body__odd__header">
            <xsl:call-template name="getVariable">
                <xsl:with-param name="id" select="'Body odd header'"/>
                <xsl:with-param name="params">
                    <!--   <prodname>
                        <xsl:value-of select="$productName"/>
                    </prodname>-->
                    <heading>
                        <fo:inline xsl:use-attribute-sets="__body__odd__header__heading">
                            <fo:retrieve-marker retrieve-class-name="current-header"/>
                        </fo:inline>
                    </heading>
                </xsl:with-param>
            </xsl:call-template>
        </fo:block>
    </fo:static-content>
</xsl:template>

К сожалению, этот шаблон распространяется на все первые страницы всех частей.

Кто-нибудь сталкивался с этой проблемой раньше. Я хочу, чтобы этот заголовок применялся только к первой странице первого уровня

заранее спасибо

Арул


person user3004456    schedule 01.02.2019    source источник


Ответы (1)


Я не уверен насчет dita, но эта проблема находится в #8.5 под (Apache's ) Часто задаваемые вопросы по XSL-FO и могут быть достигнуты (с ресурсами fo) примерно так:

<?xml version="1.0"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <!-- layout master set: -->
  <fo:layout-master-set>
    <!-- page master for 1st page -->
    <!-- define a (e.g.) A4 page-master with extra 20mm header region for the first page -->
    <fo:simple-page-master master-name="myFirst"
       page-height="297mm" page-width="210mm"
       margin-top="20mm" margin-bottom="20mm"
       margin-left="25mm" margin-right="25mm">
       <fo:region-body margin-top="20mm"/>
       <fo:region-before region-name="myHeaderFirst" extent="20mm"/>
       <!-- define custom footer with &lt;fo:region-after/&gt; ... -->
   </fo:simple-page-master>
   <!-- page master for "rest" page (body only) -->
   <fo:simple-page-master master-name="myRest"
       page-height="297mm" page-width="210mm"
       margin-top="20mm" margin-bottom="20mm"
       margin-left="25mm" margin-right="25mm">
       <!-- define only/same body -->
       <fo:region-body/>
   </fo:simple-page-master>
   <!-- Da page seekwendz masta! ..combining myFirst and myRest ;) -->
   <fo:page-sequence-master master-name="myDocument">
     <fo:repeatable-page-master-alternatives>
       <!-- here comes fo magic: "page-position" in (first|last|rest|any|only)
         ..with precedence! -->
       <fo:conditional-page-master-reference page-position="first"
         master-reference="myFirst"/>
       <fo:conditional-page-master-reference page-position="rest"
         master-reference="myRest"/>
     </fo:repeatable-page-master-alternatives>
   </fo:page-sequence-master>
 </fo:layout-master-set>

 <!-- here go the contents/page sequences ... -->
 <fo:page-sequence master-reference="myDocument">
    <!-- static content BEFORE flow! (a small pitfall,
      esp. when it is the footer not the header:)) -->
    <fo:static-content flow-name="myHeaderFirst">
      TODO : "print" your header for first page here.
    </fo:static-content>
    <!-- define other/more static-contents ... -->
    <fo:flow flow-name="xsl-region-body">
      TODO : "print" flow/body.
       <!-- xsl:applyTemplates /-->
    </fo:flow>
  </fo:page-sequence>
</fo:root>
person xerx593    schedule 01.02.2019