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]Problème de données dynamiques dans un tableau.


Sujet :

XSL/XSLT/XPATH XML

  1. #1
    Membre habitué
    Inscrit en
    Mai 2007
    Messages
    262
    Détails du profil
    Informations personnelles :
    Âge : 37

    Informations forums :
    Inscription : Mai 2007
    Messages : 262
    Points : 172
    Points
    172
    Par défaut [xsl-fo]Problème de données dynamiques dans un tableau.
    Bonjour !!!

    J'ai un soucis avec mon tableau et je n'arrive pas à trouver l'erreur...

    Je vous envois le code correspondant.
    Il me dit que mon table-body ne possède pas tous ses éléments (table-cell, table-row...)
    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
    <fo:table-body>
    <xsl:apply-templates select="Tableau"/>
    </fo:table-body>
    
    <xsl:template match="Tableau">
    <xsl:apply-templates select="Ligne"/>
    </xsl:template>
    
    <xsl:template match="Ligne">
    <xsl:if test="count(ancestor::Tableau/Ligne) = 1">
    	<fo:table-row >
    	<fo:table-cell text-align="center"  border-left-color="black" border-left-style="solid" border-left-width="0.5pt">
    	<fo:block color="{$bleu}" padding-top="2pt" padding-bottom="2pt" >
    	  <xsl:apply-templates select="Cellule"/>
    	</fo:block>
    	</fo:table-cell>
    	</fo:table-row>
    </xsl:if>
    <xsl:if test="count(ancestor::Tableau/Ligne) > 1 and position()!=last()">
    	<fo:table-row>
    	<fo:table-cell text-align="center"  border-left-color="black" border-left-style="solid" border-left-width="0.5pt" >
    	<fo:block color="{$bleu}" padding-top="2pt" padding-bottom="2pt" >
    	  <xsl:apply-templates select="Cellule"/>
    	</fo:block>
    	</fo:table-cell>
    	</fo:table-row>
    </xsl:if>
    <xsl:if test="count(ancestor::Tableau/Ligne) > 1 and position()=last()">
    	<fo:table-row>
    	<fo:table-cell text-align="center"  border-left-color="black" border-left-style="solid" border-left-width="0.5pt"  border-right-color="black" border-right-width="0.5pt" border-right-style="solid">
    	<fo:block color="{$bleu}" padding-top="2pt" padding-bottom="2pt" >
    	  <xsl:apply-templates select="Cellule"/>
    	</fo:block>
    	</fo:table-cell>
    	</fo:table-row>
    </xsl:if>
    </xsl:template>
    
    xsl:template match="Cellule">
    <xsl:choose>
    <xsl:when test="@style='titre'">
    	<fo:table-cell text-align="center" border-left-color="black" border-left-style="solid" border-left-width="0.5pt" border-bottom-color="black" border-bottom-style="solid" border-bottom-width="0.5pt" >
    	<fo:block color="{$bleu}" padding-top="2pt" padding-bottom="2pt"  >
    	  <xsl:apply-templates select="Texte"/>
    	</fo:block>
    	</fo:table-cell>
    </xsl:when>
    <xsl:otherwise>
    </xsl:otherwise>
    </xsl:choose>		
    </xsl:template>
    Voila merci...

  2. #2
    Membre habitué
    Inscrit en
    Mai 2007
    Messages
    262
    Détails du profil
    Informations personnelles :
    Âge : 37

    Informations forums :
    Inscription : Mai 2007
    Messages : 262
    Points : 172
    Points
    172
    Par défaut
    Autant pour moi !!!

    Trop de balises inutiles....

    Je vous envoie le code corrigé :
    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
     
    <xsl:template match="Tableau">
    <xsl:apply-templates select="Ligne"/>
    </xsl:template>
     
    <xsl:template match="Ligne">
    <xsl:if test="count(ancestor::Tableau/Ligne) = 1">
     <fo:table-row >
      <xsl:apply-templates select="Cellule"/>
      </fo:table-row>
    </xsl:if>
    <xsl:if test="count(ancestor::Tableau/Ligne) > 1 and position()!=last()">
      <fo:table-row>
      <xsl:apply-templates select="Cellule"/>
      </fo:table-row>
    </xsl:if>
    <xsl:if test="count(ancestor::Tableau/Ligne) > 1 and position()=last()">
      <fo:table-row>
      <xsl:apply-templates select="Cellule"/>
      </fo:table-row>
    </xsl:if>
    </xsl:template>
     
    <xsl:template match="Cellule">
    <xsl:choose>
    <xsl:when test="@style='titre'">
      <fo:table-cell text-align="center" border-left-color="black" border-left-style="solid" border-left-width="0.5pt" border-bottom-color="black" border-bottom-style="solid" border-bottom-width="0.5pt" >
      <fo:block color="{$bleu}" padding-top="2pt" padding-bottom="2pt"  >
      <xsl:apply-templates select="Texte"/>
      </fo:block>
      </fo:table-cell>
    </xsl:when>
    <xsl:otherwise>
     
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 9
    Dernier message: 13/12/2009, 13h28
  2. [FPDF] problème avec les images dans un tableau dynamique
    Par GADSN dans le forum Bibliothèques et frameworks
    Réponses: 4
    Dernier message: 08/04/2009, 11h11
  3. [CS3] problème affichage données dynamique
    Par chrismesnil dans le forum Dreamweaver
    Réponses: 7
    Dernier message: 09/07/2008, 17h56
  4. Réponses: 1
    Dernier message: 18/07/2007, 18h44
  5. Données dynamiques dans les Labels
    Par Pedro Varela dans le forum Accès aux données
    Réponses: 4
    Dernier message: 11/12/2006, 13h07

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