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 :

Split d'un élément en XSL [XSLT 1.0]


Sujet :

XSL/XSLT/XPATH XML

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2013
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Conseil

    Informations forums :
    Inscription : Avril 2013
    Messages : 6
    Par défaut Split d'un élément en XSL
    Bonjour à tous,

    je désire faire un split d'un élément.


    XML en entrée :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <META>
    <MOTS_CLES>x-y-e-z</MOTS_CLES>
    </META>
    XSL en entrée :

    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
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:lom="http://ltsc.ieee.org/xsd/LOM" xmlns:lomfr="http://www.lom-fr.fr/xsd/LOMFR" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM http://ltsc.ieee.org/xsd/lomv1.0/lom.xsd">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
     
     
     
     <xsl:template match="node()|@*">
         <xsl:copy>
           <xsl:apply-templates select="node()|@*"/>
         </xsl:copy>
     </xsl:template>
     
     <xsl:template match="MOTS_CLES" name="split">
      <xsl:param name="pText" select="."/>
     
      <xsl:if test="$pText">
       <MOTS_CLES>
         <xsl:value-of select="substring-before(concat($pText, '-'), '-')"/>
       </MOTS_CLES>
     
       <xsl:call-template name="split">
         <xsl:with-param name="pText" select="substring-after($pText, '-')"/>
       </xsl:call-template>
      </xsl:if>
     </xsl:template>
    </xsl:stylesheet>
    Et xml généré

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    <META>
    <MOTS_CLES>x</MOTS_CLES>
    <MOTS_CLES>y</MOTS_CLES>
    <MOTS_CLES>e</MOTS_CLES>
    <MOTS_CLES>z</MOTS_CLES>
    </META>


    Je désire dédoubler le mot-clé comme ci-dessus et je n'arrive pas à l'appliquer dans la XSL. Tous les champs sont affiché en XML généré mais je n'arrive pas à générer le split des mots clés dans la xsl que je vais transmettre.

    Quelqu'un peut me conseiller?

    Merci, bonne aprèm

    François

    PS: Courstest c'est le xml en input
    Fichiers attachés Fichiers attachés

  2. #2
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 582
    Par défaut
    Citation Envoyé par François8515 Voir le message
    Quelqu'un peut me conseiller?
    Oui : concentre-toi d'abord pour faire le split() et ne fais absolument rien d'autre dans ta stylesheet.
    Le reste, tu l'ajouteras ensuite, quand tu auras la solution à ce problème.
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  3. #3
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2013
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Conseil

    Informations forums :
    Inscription : Avril 2013
    Messages : 6
    Par défaut SUITE
    Alors voila l'avancée

    XML en input (en essayant uniquement le template relatif au split)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <lom:keyword><lom:string language="fre">Mot clé,ll,ttt</lom:string></lom:keyword>
    XSL en input

    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
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:lom="http://ltsc.ieee.org/xsd/LOM" xmlns:lomfr="http://www.lom-fr.fr/xsd/LOMFR" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM http://ltsc.ieee.org/xsd/lomv1.0/lom.xsd">
     
     
    	<xsl:template match = "/">
    		<lom:lom>  
    			<lom:general> 
     
    				<lom:keyword>
    					<lom:string language="fre">
    						<xsl:value-of select="META/MOTS_CLES"/>
    					</lom:string>				
     
    			</lom:keyword>	
     
    </lom:general>
     
     
    </lom:lom>
     
    	</xsl:template>
     
     
     
    <xsl:template match ="/">
        <xsl:element name="lom:lom">
             <xsl:call-template name="tmpSplitString">
     
     
     
                 <xsl:with-param name="stringtosplit" select ="META/MOTS_CLES" />
            </xsl:call-template>
        </xsl:element>
      </xsl:template>
     
     
     
      <xsl:template name="tmpSplitString">
        <xsl:param name="stringtosplit" />
        <xsl:variable name="first" select="substring-before($stringtosplit, ',')" />
        <xsl:variable name="remaining" select="substring-after($stringtosplit, ',')" />
        <xsl:element name ="lom:keyword">
          <xsl:value-of select="$first" />
        </xsl:element>
        <xsl:if test="$remaining">
          <xsl:call-template name="tmpSplitString">
            <xsl:with-param name="stringtosplit" select="$remaining" />
          </xsl:call-template>
        </xsl:if>
     
     
      </xsl:template>
     
    </xsl:stylesheet>



    XML généré en sortie


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    <?xml version="1.0"?>
    <lom:lom xmlns:lom="http://ltsc.ieee.org/xsd/LOM"><lom:keyword>Mot clé</lom:keyword><lom:keyword>tt</lom:keyword><lom:keyword>yy</lom:keyword><lom:keyword/></lom:lom>

  4. #4
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2013
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Conseil

    Informations forums :
    Inscription : Avril 2013
    Messages : 6
    Par défaut
    Maintenant je désire la chose suivante,

    je désire tout coller et là le mot_clé ne s'affiche pas

    XML en entrée

    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
    <?xml version="1.0" encoding="UTF-8"?>
    <META xmlns:xs="http://www.w3.org/2001/XMLSchema">               
            <AUTEURS>        
                <AUTEUR>auteur1</AUTEUR>
                <AUTEUR>auteur2</AUTEUR>
                <PRESENTATION_AUTEUR>Présentation1</PRESENTATION_AUTEUR>
            </AUTEURS>    
            <DESCRIPTION>Description</DESCRIPTION>
            <CONSEIL_METHODO_COURS>Conseils méthodologiques</CONSEIL_METHODO_COURS>
            <DUREE>Durée</DUREE>
            <MOTS_CLES>Mot clé-ll,</MOTS_CLES>
            <PREREQUIS>Prérequis</PREREQUIS>
            <BIBLIOGRAPHIE_COURS>Bibliographie</BIBLIOGRAPHIE_COURS>
            <TITRE_RESSOURCE>Titre de la ressource</TITRE_RESSOURCE>        
            <VALEUR>Valeur d'identification de la ressource</VALEUR>                
            <VERSION>Version</VERSION>    
            <DATE>0001-01-01</DATE>
            <VALEUR_METADONNEES>Identifiant de la métadonnée</VALEUR_METADONNEES>                
            <TECHNIQUE_LOCALISATION>Localisation du document à déposer</TECHNIQUE_LOCALISATION>                        
            <DUREE_APPRENTISSAGE>1900-01-01T00:00:00</DUREE_APPRENTISSAGE>            
    </META>

    XSL en entrée


    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
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:lom="http://ltsc.ieee.org/xsd/LOM" xmlns:lomfr="http://www.lom-fr.fr/xsd/LOMFR" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM http://ltsc.ieee.org/xsd/lomv1.0/lom.xsd">
     
     
     
        <xsl:template match = "/">
            <lom:lom>  
                <lom:general>  
                    <lom:title>
                        <lom:string language="fre">
                            <xsl:value-of select="META/TITRE_RESSOURCE"/>
                        </lom:string>
                    </lom:title>
                    <lom:identifier>
                        <lom:catalog>URI</lom:catalog>
                        <lom:entry>
                            <xsl:value-of select="META/VALEUR"/>
                        </lom:entry> 
                    </lom:identifier>
                    <lom:language>fre</lom:language>
                    <lom:description>
                        <lom:string language="fre">
                            <xsl:value-of select="META/DESCRIPTION"/>
                        </lom:string>
                    </lom:description>
                    <lomfr:documentType xmlns:lomfr="http://www.lom-fr.fr/xsd/LOMFR">
              <lomfr:source>LOMFRv1.0</lomfr:source>
              <lomfr:value>ressource interactive</lomfr:value>
            </lomfr:documentType>
     
     
     
     
                    <lom:keyword>
                        <lom:string language="fre">
                            <xsl:value-of select="META/MOTS_CLES"/>
                        </lom:string>                    
                    </lom:keyword>
     
                </lom:general>  
                <lom:lifeCycle>  
     
                    <lom:version>
                        <lom:string language="fre">
                            <xsl:value-of select="META/VERSION"/>
                        </lom:string>
                    </lom:version>
                      <lom:status>
       <lom:source>LOMv1.0</lom:source>
       <lom:value>final</lom:value>
      </lom:status>
                    <lom:contribute>
                        <lom:role>
                            <lom:source>LOMv1.0</lom:source>
                                <lom:value>author</lom:value>
                        </lom:role>
                        <lom:entity>
                        <xsl:value-of select="META/AUTEURS"/>
                    </lom:entity>
                    <lom:entity>
                        <xsl:value-of select="META/AUTEURS"/>
                    </lom:entity>
     
                        <lom:date>
                            <lom:dateTime>
                                <xsl:value-of select="META/DATE"/>
                            </lom:dateTime>
                        </lom:date>
                    </lom:contribute>
                </lom:lifeCycle> 
                <lom:metaMetadata>
                    <lom:contribute>
                        <lom:value>
                            <xsl:value-of select="META/VALEUR_METADONNEES"/>
                        </lom:value>
                        <lom:role>
                    <lom:source>LOMv1.0</lom:source>
                    <lom:value>creator</lom:value>
                </lom:role>
                        <lom:entity><xsl:value-of select="META/AUTEURS"/></lom:entity>
     
     
                        <lom:date>
                            <lom:dateTime>
                                <xsl:value-of select="META/DATE"/>
                            </lom:dateTime>
                        </lom:date>
                    </lom:contribute>
                </lom:metaMetadata>
                <lom:technical>
                      <lom:format>text/css</lom:format>
      <lom:format>application/x-shockwave-flash</lom:format>
      <lom:format>text/html</lom:format>
      <lom:format>application/pdf</lom:format>
      <lom:format>application/xml</lom:format>
      <lom:format>image/gif</lom:format>
      <lom:format>image/jpeg</lom:format>
      <lom:format>image/png</lom:format>
      <lom:format>video/quicktime</lom:format>
                    <lom:location>
                        <xsl:value-of select="META/TECHNIQUE_LOCALISATION"/>
                    </lom:location>
                    <lom:requirement>
                        <lom:orComposite>
                            <lom:type>
         <lom:source>LOMv1.0</lom:source>
         <lom:value>browser</lom:value>
        </lom:type>
                                <lom:name>
         <lom:source>LOMv1.0</lom:source>
         <lom:value>any</lom:value>
        </lom:name>
                             <lom:minimumVersion>"Mozilla Firefox : 2+","Google Chrome : toutes versions","Internet Explorer : 7+","Opera : 9+","Safari : 2+"</lom:minimumVersion>
                    <lom:maximumVersion>"Mozilla Firefox : 2+","Google Chrome : toutes versions","Internet Explorer : 7+","Opera : 9+","Safari : 2+"</lom:maximumVersion>
                        </lom:orComposite>
                    </lom:requirement>
                        <lom:installationRemarks>
                <lom:string language="fre">Lire le fichier "spécification " présent dans chaque leçon.</lom:string>
            </lom:installationRemarks>
                       <lom:otherPlatformRequirements>
                <lom:string language="fre">Nécessite "Flash Player", "Quick Time Player", "Acrobat Reader".</lom:string>
            </lom:otherPlatformRequirements>
                </lom:technical>
                <lom:educational>
                     <lom:interactivityType>
                <lom:source>LOMv1.0</lom:source>
                <lom:value>mixed</lom:value>
            </lom:interactivityType>
                     <lom:context>
                <lom:source>LOMv1.0</lom:source>
                <lom:value>higher education</lom:value>
            </lom:context>
     
                      <lom:interactivityLevel>
       <lom:source>LOMv1.0</lom:source>
       <lom:value>medium</lom:value>
      </lom:interactivityLevel>
            <lom:difficulty>
                <lom:source>LOMv1.0</lom:source>
                <lom:value>medium</lom:value>
            </lom:difficulty>
                    <lom:typicalLearningTime> 
                        <lom:duration>
                            <xsl:value-of select="META/DUREE_APPRENTISSAGE"/>
                        </lom:duration>
                        <lom:description>
                    <lom:string language="fre">Licence ou M1 ou M2</lom:string>
                </lom:description>
                <lom:language>fre</lom:language>
     
                    </lom:typicalLearningTime> 
                </lom:educational>  
                <lom:rights>
                    <lom:cost>
       <lom:source>LOMv1.0</lom:source>
       <lom:value>no</lom:value>
      </lom:cost>
                  <lom:copyrightAndOtherRestrictions>
       <lom:source>LOMv1.0</lom:source>
       <lom:value>yes</lom:value>
      </lom:copyrightAndOtherRestrictions>
                      <lom:description>
       <lom:string language="fre">Etre inscrit en Droit dans une université partenaire de l'UNJF</lom:string>
      </lom:description>
                </lom:rights>
                <lom:classification>
                      <lom:purpose>
       <lom:source>LOMv1.0</lom:source>
       <lom:value>competency</lom:value>
      </lom:purpose>
                </lom:classification>
            </lom:lom>
     
        </xsl:template>
     
    <xsl:template match = "AUTEUR">
                   <lom:entity>BEGIN:VCARD
                        VERSION:3.0
                        N:<xsl:value-of select="AUTEUR"/>;;;
                        FN:Nom Entier
                        EMAIL;TYPE=INTERNET:
                        ORG:
                        END:VCARD
                    </lom:entity>
        </xsl:template>
     
        <xsl:template match ="META/MOTS_CLES">
        <xsl:element name="META">
             <xsl:call-template name="tmpSplitString">
     
                 <xsl:with-param name="stringtosplit" select ="META/MOTS_CLES" />
            </xsl:call-template>
        </xsl:element>
      </xsl:template>
     
     
      <xsl:template name="tmpSplitString">
        <xsl:param name="stringtosplit" />
        <xsl:variable name="first" select="substring-before($stringtosplit, ',')" />
        <xsl:variable name="remaining" select="substring-after($stringtosplit, ',')" />
        <xsl:element name ="lom:keyword">
          <xsl:value-of select="$first" />
        </xsl:element>
        <xsl:if test="$remaining">
          <xsl:call-template name="tmpSplitString">
            <xsl:with-param name="stringtosplit" select="$remaining" />
          </xsl:call-template>
        </xsl:if>
     
     
      </xsl:template>
     
     
    </xsl:stylesheet>

    XML généré

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    <?xml version="1.0"?>
    <lom:lom xmlns:lom="http://ltsc.ieee.org/xsd/LOM" xmlns:lomfr="http://www.lom-fr.fr/xsd/LOMFR" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><lom:general><lom:title><lom:string language="fre">Titre de la ressource</lom:string></lom:title><lom:identifier><lom:catalog>URI</lom:catalog><lom:entry>Valeur d'identification de la ressource</lom:entry></lom:identifier><lom:language>fre</lom:language><lom:description><lom:string language="fre">Description</lom:string></lom:description><lomfr:documentType><lomfr:source>LOMFRv1.0</lomfr:source><lomfr:value>ressource interactive</lomfr:value></lomfr:documentType><lom:keyword><lom:string language="fre">Mot clé-ll</lom:string></lom:keyword></lom:general><lom:lifeCycle><lom:version><lom:string language="fre">Version</lom:string></lom:version><lom:status><lom:source>LOMv1.0</lom:source><lom:value>final</lom:value></lom:status><lom:contribute><lom:role><lom:source>LOMv1.0</lom:source><lom:value>author</lom:value></lom:role><lom:entity>
    auteur1
    auteur2
    Présentation1
    </lom:entity><lom:entity>
    auteur1
    auteur2
    Présentation1
    </lom:entity><lom:date><lom:dateTime>0001-01-01</lom:dateTime></lom:date></lom:contribute></lom:lifeCycle><lom:metaMetadata><lom:contribute><lom:value>Identifiant de la métadonnée</lom:value><lom:role><lom:source>LOMv1.0</lom:source><lom:value>creator</lom:value></lom:role><lom:entity>
    auteur1
    auteur2
    Présentation1
    </lom:entity><lom:date><lom:dateTime>0001-01-01</lom:dateTime></lom:date></lom:contribute></lom:metaMetadata><lom:technical><lom:format>text/css</lom:format><lom:format>application/x-shockwave-flash</lom:format><lom:format>text/html</lom:format><lom:format>application/pdf</lom:format><lom:format>application/xml</lom:format><lom:format>image/gif</lom:format><lom:format>image/jpeg</lom:format><lom:format>image/png</lom:format><lom:format>video/quicktime</lom:format><lom:location>Localisation du document à déposer</lom:location><lom:requirement><lom:orComposite><lom:type><lom:source>LOMv1.0</lom:source><lom:value>browser</lom:value></lom:type><lom:name><lom:source>LOMv1.0</lom:source><lom:value>any</lom:value></lom:name><lom:minimumVersion>"Mozilla Firefox : 2+","Google Chrome : toutes versions","Internet Explorer : 7+","Opera : 9+","Safari : 2+"</lom:minimumVersion><lom:maximumVersion>"Mozilla Firefox : 2+","Google Chrome : toutes versions","Internet Explorer : 7+","Opera : 9+","Safari : 2+"</lom:maximumVersion></lom:orComposite></lom:requirement><lom:installationRemarks><lom:string language="fre">Lire le fichier "spécification " présent dans chaque leçon.</lom:string></lom:installationRemarks><lom:otherPlatformRequirements><lom:string language="fre">Nécessite "Flash Player", "Quick Time Player", "Acrobat Reader".</lom:string></lom:otherPlatformRequirements></lom:technical><lom:educational><lom:interactivityType><lom:source>LOMv1.0</lom:source><lom:value>mixed</lom:value></lom:interactivityType><lom:context><lom:source>LOMv1.0</lom:source><lom:value>higher education</lom:value></lom:context><lom:interactivityLevel><lom:source>LOMv1.0</lom:source><lom:value>medium</lom:value></lom:interactivityLevel><lom:difficulty><lom:source>LOMv1.0</lom:source><lom:value>medium</lom:value></lom:difficulty><lom:typicalLearningTime><lom:duration>1900-01-01T00:00:00</lom:duration><lom:description><lom:string language="fre">Licence ou M1 ou M2</lom:string></lom:description><lom:language>fre</lom:language></lom:typicalLearningTime></lom:educational><lom:rights><lom:cost><lom:source>LOMv1.0</lom:source><lom:value>no</lom:value></lom:cost><lom:copyrightAndOtherRestrictions><lom:source>LOMv1.0</lom:source><lom:value>yes</lom:value></lom:copyrightAndOtherRestrictions><lom:description><lom:string language="fre">Etre inscrit en Droit dans une université partenaire de l'UNJF</lom:string></lom:description></lom:rights><lom:classification><lom:purpose><lom:source>LOMv1.0</lom:source><lom:value>competency</lom:value></lom:purpose></lom:classification></lom:lom>


    Le hic c'est que <lom:keyword><lom:string language="fre">Mot clé-ll</lom:string></lom:keyword> ne s'affiche pas comme dans l'exemple précédent. Quelqu'un voit où est l'erreur?

    Merci

    François

  5. #5
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 582
    Par défaut
    - Tu n'appelles pas le split. Dans l'exemple précédent tu appelais le split. Il me semble que c'est un peu évident...
    - N'utilise pas d'exemple avec un seul mot-clé quand le but est d'utiliser plusieurs mots-clé.
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  6. #6
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2013
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Conseil

    Informations forums :
    Inscription : Avril 2013
    Messages : 6
    Par défaut re
    Dsl, mais je ne vois pas trop, tu pourrais me montrer les lignes en question car c'est pas évident pour moi, vu que je débute.

    merci

  7. #7
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 582
    Par défaut
    Dans le mini-exemple qui ne fait que le split, tu as ces lignes :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <xsl:call-template name="tmpSplitString">
      <xsl:with-param name="stringtosplit" select ="META/MOTS_CLES" />
    </xsl:call-template>
    Dont le but est d'appeler le template qui s'occupe du split.

    Dans ton exemple complet, il n'y a rien de ce genre. Par contre il y a ce code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    <lom:keyword>
      <lom:string language="fre">
        <xsl:value-of select="META/MOTS_CLES"/>
      </lom:string>                    
    </lom:keyword>
    Qui donc n'en a rien à secouer du split.
    Pourquoi ? Comment le split pourrait-il avoir lieu si on ne le demande pas ?

    car c'est pas évident pour moi, vu que je débute.
    C'est pas une raison pour penser qu'un code qui n'est pas appelé va s'exécuter. Tu n'as pas assez travaillé.
    Tu aurais dû ajouter des choses étape par étape, à ton mini-exemple, et t'arrêter dès que ça ne marche plus. Là ça ne marche plus, mais tu as essayé de tout remettre en une seule fois, sans comprendre comment. Débutant ou pas, ça ne se fait pas.
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  8. #8
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2013
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Conseil

    Informations forums :
    Inscription : Avril 2013
    Messages : 6
    Par défaut
    C'est bon, merci beaucoup

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

Discussions similaires

  1. [xml + xsl] détection d'élément vide
    Par tut dans le forum XSL/XSLT/XPATH
    Réponses: 20
    Dernier message: 11/05/2007, 10h44
  2. [XSL] Recuperation du nom d'un élément
    Par Cpt.FLAM dans le forum XSL/XSLT/XPATH
    Réponses: 2
    Dernier message: 12/04/2005, 15h33
  3. [XSL] utiliser une variable pour nom d'élément
    Par luta dans le forum XSL/XSLT/XPATH
    Réponses: 13
    Dernier message: 07/09/2004, 13h58
  4. split en xsl
    Par alexandre54 dans le forum XSL/XSLT/XPATH
    Réponses: 3
    Dernier message: 17/03/2003, 10h08
  5. [xsl] Ajouter 1 élément à la page xml
    Par ametisse dans le forum XSL/XSLT/XPATH
    Réponses: 3
    Dernier message: 10/03/2003, 12h15

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