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 :

[XSLT] Trop de données suite à muench


Sujet :

XSL/XSLT/XPATH XML

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    42
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 42
    Points : 26
    Points
    26
    Par défaut [XSLT] Trop de données suite à muench
    Bonjour,
    J'ai enfin trouvé comment utiliser l'algorithme de muench pour faire un regroupement xsl

    Seulement il y a tous les cdata d'un tag qui s'affichent alors que je ne les ai jamais demandé (en tout cas sciemment)

    Donc j'amerais savoir pour n'afficher que les données du muench !

    Le code du xml :



    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
     
    <?xml version="1.0" encoding="iso-8859-1"?><!-- DWXMLSource="esh.xml" --><!DOCTYPE xsl:stylesheet  [
    	<!ENTITY nbsp   " ">
    	<!ENTITY copy   "©">
    	<!ENTITY reg    "®">
    	<!ENTITY trade  "™">
    	<!ENTITY mdash  "—">
    	<!ENTITY ldquo  "“">
    	<!ENTITY rdquo  "”"> 
    	<!ENTITY pound  "£">
    	<!ENTITY yen    "¥">
    	<!ENTITY euro   "€">
    ]>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
    <xsl:key name="tri-par-ville" match="sit_liste" use="ADRPROD_LIBELLE_COMMUNE"/>
    <xsl:template match="LEI/Resultat">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <title>Restaurants</title>
    </head>
     
    <body>
     
    <xsl:for-each select="sit_liste[count(. | key('tri-par-ville', ADRPROD_LIBELLE_COMMUNE)[1]) = 1]">
    	<xsl:sort select="ADRPROD_LIBELLE_COMMUNE"/>
    	<br /> <br />
    	<xsl:value-of select="ADRPROD_LIBELLE_COMMUNE" /><br/>
    	<xsl:for-each select="key('tri-par-ville',ADRPROD_LIBELLE_COMMUNE)">
    		<xsl:value-of select="NOM" />  <xsl:value-of select="ADRPROD_LIBELLE_COMMUNE" />   <xsl:value-of select="ADRPROD_TEL" /><br />
    	</xsl:for-each>
    </xsl:for-each>
     
    </body>
    </html>
     
    </xsl:template>
    </xsl:stylesheet>
    dans le html, tous les cdata du tag <Definition> apparaissent avant les résultats du tag <Resultat>

    Voici le code du html :

    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
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     
     
      09/08/2007 11:30:27 
      VB Consultants - assist-xml@vbc.fr 
      2000040 
      SIT_LISTECOMPLETE 
      sit_listecomplete 
     
     
     
     sit_listecomplete
     
     
     
     
     
     WEBACCESS
     
     
     
     
     
     Nom,ADRPROD_LIBELLE_COMMUNE,ADRPROD_TEL
     
     
     
     
     
     1
     
     
     
     
     
     20
     
     
     
     
     
     tous
     
     
     
     
     
     "ADRPROD_LIBELLE_COMMUNE"
     
     
     
     
     
     210
     
     
     
     
     
     |
     
     
     
     
     
     |
     
     
     
     
     
     |
     
     
     
     
     
     2
     
     
     
     
     
     2000040000000
     
     
     
     
     
     
     
     
     
     
     
     SIT_LISTECOMPLETE
     
     
     
     
      alcat,lentidad 
      30000012,210 
     
     
    With TEMP AS 
    (
      SELECT DISTINCT PPPP.Produit AS CLEF 
      FROM COMMUNS.PRODUIT_RECH PPPP
        INNER JOIN  (
            select  TYP."Type", TYP."Cat&eacute;gorie 1" "Cat&eacute;gorie 1" from  "WEBACCESS"."Types de produits" TYP 
          union all 
            select  TYP."Type", TYP."Cat&eacute;gorie 2" "Cat&eacute;gorie 1" from  "WEBACCESS"."Types de produits" TYP 
         ) TYP ON PPPP.TYPE = TYP."Type"
        INNER JOIN "WEBACCESS"."Produits" PPX ON PPPP.PRODUIT = PPX."Produit"
     WHERE  TYP."Cat&eacute;gorie 1"=:c1alcat 
        AND ( PPPP.MARQUAGE = 0  )
        AND PPX."Entit&eacute; gestionnaire"= :c1lentidad
     AND pppp.internet='Y'
    ),
     MAIN AS (select DISTINCT TEMP.CLEF, "ADRPROD_LIBELLE_COMMUNE" From "WEBACCESS"."SIT_LISTECOMPLETE" INNER JOIN TEMP on TEMP.CLEF = "WEBACCESS"."SIT_LISTECOMPLETE"."Produit" ORDER BY "ADRPROD_LIBELLE_COMMUNE"),
     CPTEUR AS (select count(clef) over () as DECOMPTE, main.* from main),
     LIMSUP AS (select rownum as ORDRE, 0 as score, cpteur.*, 'RTO' XVBC_PAGINATION from CPTEUR where rownum&lt;=:rto)
    SELECT * from LIMSUP where ORDRE&gt;=:rfrom
     
     
     
     
     Select "Produit", "Nom","ADRPROD_LIBELLE_COMMUNE","ADRPROD_TEL" From "WEBACCESS"."SIT_LISTECOMPLETE" WHERE "Produit"= :leprodz
     
     
      0,016 s. 
      14 
     
    <html>
    <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Restaurants</title>
    </head>
    <body>
    <br>
    <br>
     Bellac
     
      <br>
     Cr&ecirc;perie du Vincou
     
     
     Bellac
     
      <br>
     Le BLanzac
     
     
     Bellac
     
     
     05 55 60 24 53
     
      <br>
     Chez Boulette
     
     
     Bellac
     
     
     05 55 68 83 82
     
      <br>
     Caf&eacute;taria Lamartine
     
     
     Bellac
     
     
     05 55 68 48 37
     
      <br>
     Le Palais
     
     
     Bellac
     
     
     05 55 68 06 24
     
      <br>
     Caf&eacute; du Pont de la Pierre
     
     
     Bellac
     
     
     06 74 50 90 79
     
      <br>
     Auberge des quatre saisons
     
     
     Bellac
     
     
     05 55 53 45 45
     
      <br>
     Auberge du Vincou
     
     
     Bellac
     
     
     05 55 68 75 61
     
      <br>
    <br>
    <br>
     Blanzac
     
      <br>
     Ferme Auberge Catherine et Alex Kubiac Le Quer&eacute;
     
     
     Blanzac
     
     
     05 55 68 02 14
     
      <br>
    <br>
    <br>
     Bussi&egrave;re Boffy
     
      <br>
     Restaurant Epicerie
     
     
     Bussi&egrave;re Boffy
     
     
     05 55 68 87 74
     
      <br>
    <br>
    <br>
     Bussi&egrave;re Poitevine
     
      <br>
     Caf&eacute; restaurant de la poste
     
     
     Bussi&egrave;re Poitevine
     
     
     05 55 60 31 17
     
      <br>
    <br>
    <br>
     Nouic
     
      <br>
     Auberge de Nouic
     
     
     Nouic
     
     
     05 55 68 71 48
     
      <br>
    <br>
    <br>
     Peyrat de Bellac
     
      <br>
     Chez Sylvie
     
     
     Peyrat de Bellac
     
     
     05 55 68 11 02
     
      <br>
    <br>
    <br>
     St Bonnet de Bellac
     
      <br>
     L'Etape
     
     
     St Bonnet de Bellac
     
     
     05 55 60 09 47
     
      <br>
    </body>
    </html>
     
      listeproduits2-v4 
     
      0 ms 
      0 ms 
      16 ms 
      31 ms 
      0 ms 
     
      16 ms 
      62 ms 
      0 ms 
     
      0 ms 
      0 ms 
      0 ms 
      0 ms 
      0 ms 
     
      0 ms 
      16 ms 
      16 ms 
      0 ms 
     
      16 ms 
      0 ms 
      0 ms 
      0 ms 
      0 ms 
      0 ms 
      0 ms 
     
      0 ms 
      172 ms
    Merci de vos réponses !

  2. #2
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    42
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 42
    Points : 26
    Points
    26
    Par défaut
    J'ai trouvé
    Il fallait metter le match="/" au template
    et metter le chemin des différents tag dans le premier for-each !

    Voici le code si ça intéresse quelqu'un :

    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
     
    <?xml version="1.0" encoding="iso-8859-1"?><!-- DWXMLSource="esh.xml" --><!DOCTYPE xsl:stylesheet  [
    	<!ENTITY nbsp   " ">
    	<!ENTITY copy   "©">
    	<!ENTITY reg    "®">
    	<!ENTITY trade  "™">
    	<!ENTITY mdash  "—">
    	<!ENTITY ldquo  "“">
    	<!ENTITY rdquo  "”"> 
    	<!ENTITY pound  "£">
    	<!ENTITY yen    "¥">
    	<!ENTITY euro   "€">
    ]>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
    <xsl:key name="tri-par-ville" match="LEI/Resultat/sit_liste" use="ADRPROD_LIBELLE_COMMUNE"/>
    <xsl:template match="/">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <title>Restaurants</title>
    </head>
     
    <body>
     
    <xsl:for-each select="LEI/Resultat/sit_liste[count(. | key('tri-par-ville', ADRPROD_LIBELLE_COMMUNE)[1]) = 1]">
    	<xsl:sort select="ADRPROD_LIBELLE_COMMUNE"/>
    	<br /> <br />
    	<xsl:value-of select="ADRPROD_LIBELLE_COMMUNE" /><br/>
    	<xsl:for-each select="key('tri-par-ville',ADRPROD_LIBELLE_COMMUNE)">
    		<xsl:value-of select="NOM" />  <xsl:value-of select="ADRPROD_LIBELLE_COMMUNE" />   <xsl:value-of select="ADRPROD_TEL" /><br />
    	</xsl:for-each>
    </xsl:for-each>
     
    </body>
    </html>
     
    </xsl:template>
    </xsl:stylesheet>

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

Discussions similaires

  1. [MySQL] Affichage de données suite à un update
    Par Sandara dans le forum PHP & Base de données
    Réponses: 10
    Dernier message: 20/06/2006, 12h38
  2. [PHP] Recuperer une donnée suite a un webservice
    Par budiste dans le forum XML/XSL et SOAP
    Réponses: 12
    Dernier message: 10/04/2006, 22h11
  3. perte de données suite plantage
    Par patbeautifulday1 dans le forum Access
    Réponses: 1
    Dernier message: 21/02/2006, 16h12
  4. Réponses: 13
    Dernier message: 28/07/2005, 13h11
  5. [XSLT] Réorganisation des données
    Par castaka dans le forum XSL/XSLT/XPATH
    Réponses: 3
    Dernier message: 27/06/2005, 18h24

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