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

Dotnet Discussion :

[WebForms][Xml][Xsl] Comment eviter un décalage des images ?


Sujet :

Dotnet

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2004
    Messages
    59
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2004
    Messages : 59
    Points : 32
    Points
    32
    Par défaut [WebForms][Xml][Xsl] Comment eviter un décalage des images ?
    Bonjour à tous,

    j'avais trouvé en aspx le code pour transformer le xml et le xls et l'afficher dans la pages aspx

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     <asp:Xml id="Xml1" runat="server" DocumentSource="test.xml" TransformSource="test.xslt"></asp:Xml>

    mais il décale toutes mes images

    j'ai remarqué que le code généré est la cause de cette erreur. Son indentation est mal faite et le code es tdonc mal lu. Ce qui provoque u ndécalage entre toutes les images.

    Y a t il un moyen pour éviter ça ?

  2. #2
    Membre régulier Avatar de boleduch
    Profil pro
    Inscrit en
    Juillet 2005
    Messages
    141
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Juillet 2005
    Messages : 141
    Points : 124
    Points
    124
    Par défaut
    Hello,

    Ca dois surement venir de ton test.xslt non ? Ou alors j'ai pas compris ton problème....

  3. #3
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2004
    Messages
    59
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2004
    Messages : 59
    Points : 32
    Points
    32
    Par défaut
    difficile à vérifier si c'est le xsl. mais je vais vous donner le code de mon xsl au cas ou.

    edit : lorsque je fais une transformation classique à partir de ma page xml , elle s'affiche correctement

    voici le code du .xsl :

    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
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" encoding="iso-8859-1" indent="yes" version="1.0" />
    <xsl:decimal-format name="std" decimal-separator="," grouping-separator=" "/>
    <xsl:template match="/">
    <html>
     
    <head>
      <title>Untitled-Generated with trial version of MoreMotion Web Designer</title>
      <meta http-equiv="content-language" content="fr"/>
      <meta name="Generator" content="MoreMotion Web Designer Trial Version"/>
      <style type="text/css"> 
        a:link {color: #0000FF}
        a:visited {color: #800080}
        a:active {color: #FF0000}
        .c1   {margin: 0px; background-color: #ffffff}
        .c2   {font-family: verdana; font-size: 10pt; text-align: left; color: #000000}
        .c3   {padding: 0px 2px 0px 2px}
      </style>
    </head>
    <body  topmargin="0" leftmargin="0" class="c1">
    <table cellspacing="0" cellpadding="0" width="1024" class="c2">
      <tr>
        <td rowspan="2" colspan="12" valign="top"><img name="image21" src="images/RayonFemme2.jpg" width="736" height="42" border="0"></img></td>
        <td colspan="2" valign="top"><img name="image22" src="images/RayonFemme2-03.jpg" width="148" height="40" border="0"></img></td>
        <td rowspan="21" valign="top"><img name="image23" src="images/RayonFemme2-04.jpg" width="140" height="800" border="0"></img></td>
        <td height="40"/>
      </tr>
      <tr>
        <td rowspan="2" colspan="2" valign="top"><img name="image24" src="images/RayonFemme2-05.jpg" width="148" height="56" border="0"></img></td>
        <td height="2"/>
      </tr>
      <tr>
        <td rowspan="3" colspan="2" valign="top"><img name="image25" src="images/RayonFemme2-06.jpg" width="270" height="164" border="0"></img></td>
        <td colspan="2" valign="top"><a href="/indexprototype.html"><img name="image26" src="images/RayonFemme2-07.jpg" width="93" height="54" border="0"></img></a></td>
        <td colspan="2" valign="top"><img name="image27" src="images/RayonFemme2-08.jpg" width="93" height="54" border="0"></img></td>
        <td colspan="2" valign="top"><img name="image212" src="images/RayonFemme2-09.jpg" width="94" height="54" border="0"></img></td>
        <td colspan="2" valign="top"><img name="image211" src="images/RayonFemme2-10.jpg" width="93" height="54" border="0"></img></td>
        <td colspan="2" valign="top"><img name="image210" src="images/RayonFemme2-11.jpg" width="93" height="54" border="0"></img></td>
        <td height="54"/>
      </tr>
      <tr>
        <td colspan="12" valign="top"><img name="image29" src="images/RayonFemme2-12.jpg" width="614" height="85" border="0"></img></td>
        <td height="85"/>
      </tr>
      <tr>
        <td valign="top"><img name="image28" src="images/RayonFemme2-13.jpg" width="28" height="25" border="0"></img></td>
        <td rowspan="5" colspan="11" valign="top"><img name="image217" src="images/RayonFemme2-14.jpg" width="586" height="101" border="0"></img></td>
        <td height="25"/>
      </tr>
      <tr>
        <td rowspan="16" valign="top"><img name="image214" src="images/RayonFemme2-15.jpg" width="142" height="594" border="0"></img></td>
        <td colspan="2" valign="top"><img name="image213" src="images/RayonFemme2-16.jpg" width="156" height="19" border="0"></img></td>
        <td height="19"/>
      </tr>
      <tr>
        <td colspan="2" valign="top"><a href="http://localhost/test%20fredo/Site1/testtransfert.aspx?page=courtes&amp;fonction=taxe&amp;para=15"><img name="image231" src="images/RayonFemme2-17.jpg" width="156" height="19" border="0"></img></a></td>
        <td height="19"/>
      </tr>
      <tr>
        <td colspan="2" valign="top"><a href="http://localhost/test%20fredo/Site1/testtransfert.aspx?page=longues&amp;fonction=taxe&amp;para=22"><img name="image232" src="images/RayonFemme2-18.jpg" width="156" height="19" border="0"></img></a></td>
        <td height="19"/>
      </tr>
      <tr>
        <td colspan="2" valign="top"><img name="image222" src="images/RayonFemme2-19.jpg" width="156" height="19" border="0"></img></td>
        <td height="19"/>
      </tr>
      <tr>
        <td colspan="2" valign="top"><img name="image221" src="images/RayonFemme2-20.jpg" width="156" height="18" border="0"></img></td>
        <td rowspan="3" colspan="11" valign="top"><img name="image223" src="images/RayonFemme2-21.jpg" width="586" height="44" border="0"></img></td>
        <td height="18"/>
      </tr>
      <tr>
        <td colspan="2" valign="top"><img name="image220" src="images/RayonFemme2-22.jpg" width="156" height="19" border="0"></img></td>
        <td height="19"/>
      </tr>
      <tr>
        <td rowspan="2" colspan="2" valign="top"><img name="image219" src="images/RayonFemme2-23.jpg" width="156" height="14" border="0"></img></td>
        <td height="7"/>
      </tr>
      <tr>
        <td rowspan="3" colspan="11" valign="top"><img name="image230" width="586" height="33" border="0">
          <xsl:attribute name="src">images/<xsl:value-of select="/root/Produits/Item/image/courtes/urlimage1"/></xsl:attribute>
        </img></td>
        <td height="7"/>
      </tr>
      <tr>
        <td colspan="2" valign="top"><img name="image218" src="images/RayonFemme2-25.jpg" width="156" height="24" border="0"></img></td>
        <td height="24"/>
      </tr>
      <tr>
        <td rowspan="7" colspan="2" valign="top"><img name="image229" src="images/RayonFemme2-26.jpg" width="156" height="443" border="0"></img></td>
        <td height="2"/>
      </tr>
      <tr>
        <td colspan="2" valign="top"><img name="image224" width="147" height="134" border="0">
          <xsl:attribute name="src">images/<xsl:value-of select="/root/Produits/Item/image/courtes/urlimage2"/></xsl:attribute>
        </img></td>
        <td colspan="4" valign="top"><img name="image225" width="146" height="134" border="0">
          <xsl:attribute name="src">images/<xsl:value-of select="/root/Produits/Item/image/courtes/urlimage3"/></xsl:attribute>
        </img></td>
        <td colspan="4" valign="top"><img name="image226" width="147" height="134" border="0">
          <xsl:attribute name="src">images/<xsl:value-of select="/root/Produits/Item/image/courtes/urlimage4"/></xsl:attribute>
        </img></td>
        <td valign="top"><img name="image227" width="146" height="134" border="0">
          <xsl:attribute name="src">images/<xsl:value-of select="/root/Produits/Item/image/courtes/urlimage5"/></xsl:attribute>
        </img></td>
        <td height="134"/>
      </tr>
      <tr>
        <td colspan="11" valign="top"><img name="image215" width="586" height="28" border="0">
          <xsl:attribute name="src">images/<xsl:value-of select="/root/Produits/Item/image/courtes/urlimage6"/></xsl:attribute>
        </img></td>
        <td height="28"/>
      </tr>
      <tr>
        <td colspan="11"/>
        <td height="55"/>
      </tr>
      <tr>
        <td colspan="4"/>
        <td width="229" colspan="4" class="c3">Taxe : <xsl:value-of select="root/Produits/Item/Taxe1"/> €</td>
        <td colspan="3"/>
        <td height="24"/>
      </tr>
      <tr>
        <td colspan="11"/>
        <td height="129"/>
      </tr>
      <tr>
        <td colspan="11" valign="top"><img name="image228" src="images/RayonFemme2-35.jpg" width="586" height="71" border="0"></img></td>
        <td height="71"/>
      </tr>
      <tr>
        <td width="142"/>
        <td width="128"/>
        <td width="28"/>
        <td width="65"/>
        <td width="82"/>
        <td width="11"/>
        <td width="14"/>
        <td width="80"/>
        <td width="41"/>
        <td width="52"/>
        <td width="60"/>
        <td width="33"/>
        <td width="2"/>
        <td width="146"/>
        <td width="140"/>
        <td height="0"/>
      </tr>
    </table>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>

  4. #4
    Membre régulier Avatar de boleduch
    Profil pro
    Inscrit en
    Juillet 2005
    Messages
    141
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Juillet 2005
    Messages : 141
    Points : 124
    Points
    124
    Par défaut
    Alors la je t'avoues que je vois pas...essaie d'aller poster dans le forum XSL a tout hasard.

    Désolé de pas pouvoir t'aider plus.

  5. #5
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2004
    Messages
    59
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2004
    Messages : 59
    Points : 32
    Points
    32
    Par défaut
    je donne la solution à ce problème.

    Dans la page xsl il faut mettre :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <xsl:template match="/" xml:space="preserved">

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

Discussions similaires

  1. comment eviter l'affichage des lignes vides?
    Par perloutta dans le forum ASP.NET
    Réponses: 4
    Dernier message: 21/03/2009, 16h28
  2. comment eviter le blocage des contenus actifs sur explorer
    Par reski dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 07/07/2006, 16h41
  3. Calcul/Somme XML / XSL , comment faire ?
    Par Superpoisson dans le forum XSL/XSLT/XPATH
    Réponses: 5
    Dernier message: 23/09/2005, 12h28
  4. [Noob][XML][XSL]Comment faire ceci ??
    Par Devil666 dans le forum XSL/XSLT/XPATH
    Réponses: 5
    Dernier message: 31/08/2005, 16h00
  5. [XML][XSL]Comment atteindre ces 2 header séparément?
    Par Devil666 dans le forum XSL/XSLT/XPATH
    Réponses: 7
    Dernier message: 27/05/2005, 07h36

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