Bonjour à tous,

Je suis encore un peu perdu dans la transformation par XSL . je n'arrive pas à faire marcher mon code suivant:

Mon XML

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
 
<?xml version="1.0" encoding="UTF-8"?>
<exp
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="T.xsd">
  <action action-type="create">
    <cats>
      <cat id="AD" status="A">
        <effective-date date="10-26-2005" format="mm-dd-yyyy"/>
        <owner id="Nancy"/>
        <title lang="en_US"><![CDATA[adM]]></title>
        <title lang="fr_CA"><![CDATA[ADM]]></title>
        <description lang="en_US"><![CDATA[DESC1]]></description>
        <description lang="fr_CA"><![CDATA[desc2]]></description>
      </cat>
      <cat id="oD" status="A">
        <effective-date date="10-26-2005" format="mm-dd-yyyy"/>
        <owner id="PAUL"/>
        <title lang="en_US"><![CDATA[OdM]]></title>
        <title lang="fr_CA"><![CDATA[ODM]]></title>
        <description lang="en_US"><![CDATA[DESC1]]></description>
        <description lang="fr_CA"><![CDATA[desc2]]></description>
      </cat>
    </cats>
  </action>
</exp>
Mon 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
 
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="UTF-8"/>
 
<xsl:template match="cats">
 
  <xsl:for-each select="cats/cat">INSERT INTO TCAT VALUES ("
    <xsl:value-of select="@id"/>", "
    <xsl:value-of select="title" />", "
    <xsl:value-of select="description" />");
  </xsl:for-each>
 
</xsl:template>
Merci d'avance.