IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

XSL/XSLT/XPATH XML Discussion :

[XSL-FO][docbook]Probleme affiche nombre dans table des matieres


Sujet :

XSL/XSLT/XPATH XML

  1. #1
    Membre du Club
    Inscrit en
    Février 2007
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 64
    Points : 43
    Points
    43
    Par défaut [XSL-FO][docbook]Probleme affichage numéro des pages dans table des matieres
    Bonjour
    J’ai fait une application ou je génère un document RTF avec FOP et SAXON à partir d’un fichier DocBook.
    J’ai le problème suivant : Sur le document RTF en sortie les numéros sur la table des matières s’affichent mal :
    C’est du genre N10006.

    Par contre quand j’utilise le format PDF, c’est bon. De même quand je fais la transformation en passant le fichier XML avec l’éditeur XMLMIND ( ce qui veut dire que ça ne vient pas de mon XML).
    Voilà j’utilise la XSL 1.73 de docbook et FOP 0.94.

    voila le code officiel de docbook pour la table des matieres :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    <?xml version='1.0'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:fo="http://www.w3.org/1999/XSL/Format"
                    version='1.0'>
     
    <!-- ********************************************************************
         $Id: toc.xsl 6910 2007-06-28 23:23:30Z xmldoc $
         ********************************************************************
     
         This file is part of the XSL DocBook Stylesheet distribution.
         See ../README or http://docbook.sf.net/release/xsl/current/ for
         copyright and other information.
     
         ******************************************************************** -->
     
    <!-- ==================================================================== -->
     
    <!-- FIXME: in the contexts where <toc> can occur, I think it's always
         the case that a page-sequence is required. Is that true? -->
     
    <xsl:template match="toc">
      <xsl:variable name="master-reference">
        <xsl:call-template name="select.pagemaster"/>
      </xsl:variable>
     
      <xsl:choose>
        <xsl:when test="*">
          <xsl:if test="$process.source.toc != 0">
            <!-- if the toc isn't empty, process it -->
            <fo:page-sequence hyphenate="{$hyphenate}"
                              master-reference="{$master-reference}">
              <xsl:attribute name="language">
                <xsl:call-template name="l10n.language"/>
              </xsl:attribute>
              <xsl:attribute name="format">
                <xsl:call-template name="page.number.format">
                  <xsl:with-param name="element" select="'toc'"/>
                  <xsl:with-param name="master-reference" 
                                  select="$master-reference"/>
                </xsl:call-template>
              </xsl:attribute>
     
              <xsl:attribute name="initial-page-number">
                <xsl:call-template name="initial.page.number">
                  <xsl:with-param name="element" select="'toc'"/>
                  <xsl:with-param name="master-reference" 
                                  select="$master-reference"/>
                </xsl:call-template>
              </xsl:attribute>
     
              <xsl:attribute name="force-page-count">
                <xsl:call-template name="force.page.count">
                  <xsl:with-param name="master-reference" 
    	                      select="$master-reference"/>
                </xsl:call-template>
              </xsl:attribute>
     
              <xsl:attribute name="hyphenation-character">
                <xsl:call-template name="gentext">
                  <xsl:with-param name="key" select="'hyphenation-character'"/>
                </xsl:call-template>
              </xsl:attribute>
              <xsl:attribute name="hyphenation-push-character-count">
                <xsl:call-template name="gentext">
                  <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
                </xsl:call-template>
              </xsl:attribute>
              <xsl:attribute name="hyphenation-remain-character-count">
                <xsl:call-template name="gentext">
                  <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
                </xsl:call-template>
              </xsl:attribute>
     
              <xsl:apply-templates select="." mode="running.head.mode">
                <xsl:with-param name="master-reference" select="$master-reference"/>
              </xsl:apply-templates>
              <xsl:apply-templates select="." mode="running.foot.mode">
                <xsl:with-param name="master-reference" select="$master-reference"/>
              </xsl:apply-templates>
     
              <fo:flow flow-name="xsl-region-body">
                <xsl:call-template name="set.flow.properties">
                  <xsl:with-param name="element" select="local-name(.)"/>
                  <xsl:with-param name="master-reference" 
                                  select="$master-reference"/>
                </xsl:call-template>
     
                <fo:block xsl:use-attribute-sets="toc.margin.properties">
                  <xsl:call-template name="table.of.contents.titlepage"/>
                  <xsl:apply-templates/>
                </fo:block>
              </fo:flow>
            </fo:page-sequence>
          </xsl:if>
        </xsl:when>
        <xsl:otherwise>
          <xsl:if test="$process.empty.source.toc != 0">
            <fo:page-sequence hyphenate="{$hyphenate}"
                              master-reference="{$master-reference}">
              <xsl:attribute name="language">
                <xsl:call-template name="l10n.language"/>
              </xsl:attribute>
              <xsl:attribute name="format">
                <xsl:call-template name="page.number.format">
                  <xsl:with-param name="element" select="'toc'"/>
                  <xsl:with-param name="master-reference" 
                                  select="$master-reference"/>
                </xsl:call-template>
              </xsl:attribute>
     
              <xsl:attribute name="initial-page-number">
                <xsl:call-template name="initial.page.number">
                  <xsl:with-param name="element" select="'toc'"/>
                  <xsl:with-param name="master-reference" 
                                  select="$master-reference"/>
                </xsl:call-template>
              </xsl:attribute>
     
              <xsl:attribute name="hyphenation-character">
                <xsl:call-template name="gentext">
                  <xsl:with-param name="key" select="'hyphenation-character'"/>
                </xsl:call-template>
              </xsl:attribute>
              <xsl:attribute name="hyphenation-push-character-count">
                <xsl:call-template name="gentext">
                  <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
                </xsl:call-template>
              </xsl:attribute>
              <xsl:attribute name="hyphenation-remain-character-count">
                <xsl:call-template name="gentext">
                  <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
                </xsl:call-template>
              </xsl:attribute>
     
              <xsl:apply-templates select="." mode="running.head.mode">
                <xsl:with-param name="master-reference" select="$master-reference"/>
              </xsl:apply-templates>
              <xsl:apply-templates select="." mode="running.foot.mode">
                <xsl:with-param name="master-reference" select="$master-reference"/>
              </xsl:apply-templates>
     
              <fo:flow flow-name="xsl-region-body">
                <xsl:choose>
                  <xsl:when test="parent::section
                                  or parent::sect1
                                  or parent::sect2
                                  or parent::sect3
                                  or parent::sect4
                                  or parent::sect5">
                    <xsl:apply-templates select="parent::*"
                                         mode="toc.for.section"/>
                  </xsl:when>
                  <xsl:when test="parent::article">
                    <xsl:apply-templates select="parent::*"
                                         mode="toc.for.component"/>
                  </xsl:when>
                  <xsl:when test="parent::book
                                  or parent::part">
                    <xsl:apply-templates select="parent::*"
                                         mode="toc.for.division"/>
                  </xsl:when>
                  <xsl:when test="parent::set">
                    <xsl:apply-templates select="parent::*"
                                         mode="toc.for.set"/>
                  </xsl:when>
                  <!-- there aren't any other contexts that allow toc -->
                  <xsl:otherwise>
                    <xsl:message>
                      <xsl:text>I don't know how to make a TOC in this context!</xsl:text>
                    </xsl:message>
                  </xsl:otherwise>
                </xsl:choose>
              </fo:flow>
            </fo:page-sequence>
          </xsl:if>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
     
    <xsl:template match="tocpart|tocchap
                         |toclevel1|toclevel2|toclevel3|toclevel4|toclevel5">
      <xsl:apply-templates select="tocentry"/>
      <xsl:if test="tocchap|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5">
        <fo:block start-indent="{count(ancestor::*)*2}pc">
          <xsl:apply-templates select="tocchap|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5"/>
        </fo:block>
      </xsl:if>
    </xsl:template>
     
    <xsl:template match="tocentry|tocfront|tocback">
      <fo:block text-align-last="justify"
                end-indent="2pc"
                last-line-end-indent="-2pc">
        <fo:inline keep-with-next.within-line="always">
          <xsl:choose>
            <xsl:when test="@linkend">
              <fo:basic-link internal-destination="{@linkend}">
                <xsl:apply-templates/>
              </fo:basic-link>
            </xsl:when>
            <xsl:otherwise>
              <xsl:apply-templates/>
            </xsl:otherwise>
          </xsl:choose>
        </fo:inline>
     
        <xsl:choose>
          <xsl:when test="@linkend">
            <fo:inline keep-together.within-line="always">
              <xsl:text> </xsl:text>
              <fo:leader leader-pattern="dots"
                         keep-with-next.within-line="always"/>
              <xsl:text> </xsl:text>
              <fo:basic-link internal-destination="{@linkend}">
                <xsl:choose>
                  <xsl:when test="@pagenum">
                    <xsl:value-of select="@pagenum"/>
                  </xsl:when>
                  <xsl:otherwise>
                    <fo:page-number-citation ref-id="{@linkend}"/>
                  </xsl:otherwise>
                </xsl:choose>
              </fo:basic-link>
            </fo:inline>
          </xsl:when>
          <xsl:when test="@pagenum">
            <fo:inline keep-together.within-line="always">
              <xsl:text> </xsl:text>
              <fo:leader leader-pattern="dots"
                         keep-with-next.within-line="always"/>
              <xsl:text> </xsl:text>
              <xsl:value-of select="@pagenum"/>
            </fo:inline>
          </xsl:when>
          <xsl:otherwise>
            <!-- just the leaders, what else can I do? -->
            <fo:inline keep-together.within-line="always">
              <xsl:text> </xsl:text>
              <fo:leader leader-pattern="space"
                         keep-with-next.within-line="always"/>
            </fo:inline>
          </xsl:otherwise>
        </xsl:choose>
      </fo:block>
    </xsl:template>
     
    <!-- ==================================================================== -->
     
    <xsl:template match="*" mode="toc.for.section">
    <!--
      <xsl:call-template name="section.toc"/>
    -->
    </xsl:template>
     
    <xsl:template match="*" mode="toc.for.component">
      <xsl:call-template name="component.toc"/>
    </xsl:template>
     
    <xsl:template match="*" mode="toc.for.section">
    <!--
      <xsl:call-template name="section.toc"/>
    -->
    </xsl:template>
     
    <xsl:template match="*" mode="toc.for.division">
      <xsl:call-template name="division.toc"/>
    </xsl:template>
     
    <xsl:template match="*" mode="toc.for.set">
    <!--
      <xsl:call-template name="set.toc"/>
    -->
    </xsl:template>
     
    <!-- ==================================================================== -->
     
    <xsl:template match="lot|lotentry">
    </xsl:template>
     
    </xsl:stylesheet>
    Est ce quelqu’un peut m’aider ?

    Merci d’avance

  2. #2
    Membre du Club
    Inscrit en
    Février 2007
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 64
    Points : 43
    Points
    43
    Par défaut
    bon en fait il semblerait que ça fasse partie des limitations de fop en ce qui concerne RTF.
    pas de chance...

Discussions similaires

  1. [XL-2003] probleme afficher page dans un autre classeur
    Par Jcorbeaux dans le forum Macros et VBA Excel
    Réponses: 0
    Dernier message: 07/08/2012, 23h51
  2. Afficher "Chapitre 1" dans table des matières
    Par MatPhD dans le forum Mise en forme
    Réponses: 6
    Dernier message: 07/06/2012, 16h10
  3. [QST] insérer table des figures dans tables des matieres
    Par hannibal.76 dans le forum Débuter
    Réponses: 11
    Dernier message: 04/06/2010, 12h14
  4. probleme d'insertion dans table avec cle secondaire
    Par pseudobidon57 dans le forum SQL
    Réponses: 1
    Dernier message: 01/06/2007, 13h46
  5. Réponses: 5
    Dernier message: 12/12/2005, 18h30

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo