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 :

Changement de valeur apres la transformation d'un XML


Sujet :

XSL/XSLT/XPATH XML

  1. #1
    Nouveau membre du Club
    Inscrit en
    Janvier 2009
    Messages
    138
    Détails du profil
    Informations forums :
    Inscription : Janvier 2009
    Messages : 138
    Points : 37
    Points
    37
    Par défaut Changement de valeur apres la transformation d'un XML
    j'ai deux fichier XMl f1 et f2 qui ont par exemple la structure suivante :

    f1 :



    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    <rocords>
    </rocord>
     
    <rocord_id>1</rocord_id>
     <rocord_Descreption><![CDATA[<font face="Arial" size="2" color="#003366"><span><span>A pliable adhesive  fire cement of putty-like consistency available in 5OOg and 1 kg containers<br /><br /></span></span></font><ul><li><font face="Arial" size="2" color="#003366"><span><span>Haz Class       Irritant  </span></span></font></li></ul><ul><li><font face="Arial" size="2" color="#003366"><span><span>Ensure surface is clean and free from contamination.</span></span></font></li></ul><ul><li><font face="Arial" size="2" color="#003366"><span><span>Use  straight from the tub, apply with a trowel, knife, etc and work well into the area</span></span></font></li></ul><ul><li><font face="Arial" size="2" color="#003366"><span><span>Hardens by air drying and operational heat which improves and strengthens seals and joints.  Gently apply initial heat to the fire cement over a 3-4 hour period, and then gradually increase to full operating temperature. </span></span></font></li></ul><ul><li><font face="Arial" size="2" color="#003366"><span><span>Is water based and non-toxic, withstands heat up to 1400'C (2550'F)</span></span></font></li></ul><ul><li><font face="Arial" size="2" color="#003366"><span><span>This product is specially formulated and recommended by leading industrial and domestic heating appliance manufacturers throughout the world.</span></span></font></li></ul><ul><li><font face="Arial" size="2" color="#003366"><span><span>Ideal for installation and maintenance of boilers, fires. flues, stoves. heating installations, ranges etc.  </span></span></font></li></ul><ul><li><font face="Arial" size="2" color="#003366"><span><span>Fill and smooth any fine cracks if necessary.  </span></span></font></li></ul><ul><li><font face="Arial" size="2" color="#003366"><span><span>Not suitable for large repair to masonary or rendering fireplaces. For this application see HeatProod Screed here </span></span></font></li></ul><font face="Arial" size="2" color="#003366"><span> </span></font><p>]]></rocord_Description>
     
    </rocord>
    </rocords>



    f2 :


    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    <enregistrements>
    </enregistrement>
     
    <enre_numero></enre_numero>
    <enre_Des></enre_Des>
     
    </enregistrement>
    </enregistrements>




    Quand je fais la transfoprmation de F1 en F2 avac le fichier xsl suivant :
    Code xml :


    Code xml : 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
    <?xml version="1.0" encoding="ISO-8859-1"?>
     
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     
        <xsl:template match="/">
          <enregistrements>
            <xsl:for-each select="rocords/rocord">
              <enregistrement>
                <enre_numero><xsl:value-of select="rocord_id"/></enre_numero>
                <enre_Description><xsl:value-of select="rocord_Des"/></enre_Description>
              </enregistrement>
            </xsl:for-each>
          </enregistrements>
        </xsl:template>
     
    </xsl:stylesheet>


    il change la valeur de la balise <enre_Des></enre_Des>
    en ceci :

    Code xml :

    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
     <enre_Des>&lt;font face="Arial" size="2" color="#003366"&gt;&lt;span&gt;&lt;span&gt;A pliable adhesive  fire cement of putty-like consistency available in 5OOg and 1 kg containers&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;ul&gt;&lt;li&gt;&lt;font face="Arial" size="2" color="#003366"&gt;&lt;span&gt;&lt;span&gt;Haz Class       Irritant  &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;font face="Arial" size="2" color="#003366"&gt;&lt;span&gt;&lt;span&gt;Ensure surface is clean and free from contamination.&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;font face="Arial" size="2" color="#003366"&gt;&lt;span&gt;&lt;span&gt;Use  straight from the tub, apply with a trowel, knife, etc and work well into the area&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;font face="Arial" size="2" color="#003366"&gt;&lt;span&gt;&lt;span&gt;Hardens by air drying and operational heat which improves and strengthens seals and joints.  Gently apply initial heat to the fire cement over a 3-4 hour period, and then gradually increase to full operating temperature. &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;font face="Arial" size="2" color="#003366"&gt;&lt;span&gt;&lt;span&gt;Is water based and non-toxic, withstands heat up to 1400'C (2550'F)&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;font face="Arial" size="2" color="#003366"&gt;&lt;span&gt;&lt;span&gt;This product is specially formulated and recommended by leading industrial and domestic heating appliance manufacturers throughout the world.&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;font face="Arial" size="2" color="#003366"&gt;&lt;span&gt;&lt;span&gt;Ideal for installation and maintenance of boilers, fires. flues, stoves. heating installations, ranges etc.  &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;font face="Arial" size="2" color="#003366"&gt;&lt;span&gt;&lt;span&gt;Fill and smooth any fine cracks if necessary.  &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;font face="Arial" size="2" color="#003366"&gt;&lt;span&gt;&lt;span&gt;Not suitable for large repair to masonary or rendering fireplaces. For this application see HeatProod Screed here &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;font face="Arial" size="2" color="#003366"&gt;&lt;span&gt; &lt;/span&gt;&lt;/font&gt;&lt;p&gt;</enre_Des>


    bref je pense que <> sont remplacés par &gt;&lt;
    est ce que c'est normal?
    est ce qu'il ya une solution pour que je garde les données de la balises sans changement.

    Merci

  2. #2
    Expert confirmé
    Homme Profil pro
    Inscrit en
    Septembre 2006
    Messages
    2 947
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 947
    Points : 4 369
    Points
    4 369
    Par défaut
    garder les balises sans modification n'a qu'un intérêt esthétique… du point de vue XML cela signifie exactement la même chose, mais si vous y tenez :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <enre_Description><xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text><xsl:value-of select="rocord_Description" disable-output-escaping="yes"/><xsl:text>]]</xsl:text></enre_Description>

  3. #3
    Nouveau membre du Club
    Inscrit en
    Janvier 2009
    Messages
    138
    Détails du profil
    Informations forums :
    Inscription : Janvier 2009
    Messages : 138
    Points : 37
    Points
    37
    Par défaut
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    <xsl:value-of select="rocord_Description" disable-output-escaping="yes"/><xsl:text>]]</xsl:text></enre_Description>


    ce code marche presque bien
    mais il ne ferme pas la balise en rouge
    ]]>

    j'ai essayé d'ajouter au code "en rouge" &gt;


    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
                <enre_Description>
                  <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
                  <xsl:value-of select="rocord_Description" disable-output-escaping="yes"/>
                  <xsl:text>]]</xsl:text><xsl:text >&gt;</xsl:text>
               </enre_Description>



    mais ca marche pas !!!
    Merci

  4. #4
    Expert confirmé
    Homme Profil pro
    Inscrit en
    Septembre 2006
    Messages
    2 947
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 947
    Points : 4 369
    Points
    4 369
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <enre_Description><xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text><xsl:value-of select="rocord_Description" disable-output-escaping="yes"/><xsl:text disable-output-escaping="yes">]]&gt;</xsl:text></enre_Description>

  5. #5
    Nouveau membre du Club
    Inscrit en
    Janvier 2009
    Messages
    138
    Détails du profil
    Informations forums :
    Inscription : Janvier 2009
    Messages : 138
    Points : 37
    Points
    37
    Par défaut
    plein dans le mil
    Merci infiniment

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

Discussions similaires

  1. Filtrage apres un changement de valeur dans la cellule
    Par dragondumond dans le forum VB.NET
    Réponses: 2
    Dernier message: 19/07/2013, 10h02
  2. Réponses: 0
    Dernier message: 18/04/2011, 17h53
  3. Changement de valeur apres la transformation d'un XML
    Par Ya7yaKech dans le forum Windows Forms
    Réponses: 3
    Dernier message: 19/01/2009, 17h25
  4. valeur nd dans transformer après ventilation
    Par laaboubi dans le forum Cognos
    Réponses: 0
    Dernier message: 04/11/2008, 17h46
  5. Charger Macro apres changement de valeur d'une cellule
    Par jackfred dans le forum Macros et VBA Excel
    Réponses: 3
    Dernier message: 04/07/2007, 14h51

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