salut,l'objectif de mon pfe c'est de transformer un fichier xml en un fichier xsl mais j'ai un problème au niveau de récupuration des variables de fichier xml est ce qu'il yà qqu'un wui me peux aider
voici cv.xsd:
?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--W3C Schema generated by XMLSpy v2009 sp1 (http://www.altova.com)-->
<!--Please add namespace attributes, a targetNamespace attribute and import elements according to your requirements-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xs:complexType name="cv">
<xs:sequence>
<xs:element ref="Info_perso"/>
<xs:element ref="adr" maxOccurs="unbounded"/>
<xs:element ref="Formations" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="Exp_prof" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="Domaines_compet"/>
<xs:element ref="Publications" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="honneur_recompense" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="cv" type="cv"/>
<xs:complexType name="Info_perso">
<xs:sequence>
<xs:element ref="nom"/>
<xs:element ref="prenom"/>
<xs:element ref="alias"/>
<xs:element ref="Adresse_E-mail"/>
</xs:sequence>
<xs:attribute name="age" type="xs:anySimpleType"/>
<xs:attribute name="Telephone" type=" xs:anySimpleType"/>
<xs:attribute name="langue">
<xs:simpleType>
<xs:restriction base="xs:anySimpleType">
<xs:enumeration value="ARABIC"/>
<xs:enumeration value="FRANCAIS"/>
<xs:enumeration value="ANGLAIS"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="sex">
<xs:simpleType>
<xs:restriction base="xs:anySimpleType">
<xs:enumeration value="M"/>
<xs:enumeration value="F"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:element name="Info_perso" type="Info_perso"/>
<xs:complexType name="nom" mixed="true"/>
<xs:element name="nom" type="nom"/>
<xs:complexType name="prenom" mixed="true"/>
<xs:element name="prenom" type="prenom"/>
<xs:complexType name="alias" mixed="true"/>
<xs:element name="alias" type="alias"/>
<xs:complexType name="Adresse_E-mail" mixed="true"/>
<xs:element name="Adresse_E-mail" type="Adresse_E-mail"/>
<xs:complexType name="adr">
<xs:sequence>
<xs:element ref="Ville"/>
<xs:element ref="Region"/>
<xs:element ref="Pays"/>
</xs:sequence>
<xs:attribute name="Code_postal" type="xs:anySimpleType"/>
</xs:complexType>
<xs:element name="adr" type="adr"/>
<xs:complexType name="ville" mixed="true"/>
<xs:element name="ville" type="ville"/>
<xs:complexType name="region" mixed="true"/>
<xs:element name="region" type="region"/>
<xs:complexType name="Pays" mixed="true"/>
<xs:element name="Pays" type="Pays"/>
<xs:complexType name="Formations">
<xs:sequence>
<xs:element ref="Ecoles"/>
<xs:element ref="Titre"/>
<xs:element ref="Niveau"/>
</xs:sequence>
<xs:attribute name="date" type="xs:anySimpleType"/>
<xs:attribute name="Niveau" type="xs:anySimpleType"/>
</xs:complexType>
<xs:element name="Formations" type="Formations"/>
<xs:complexType name="Ecoles" mixed="true"/>
<xs:element name="Ecoles" type="Ecoles"/>
<xs:complexType name="Titre" mixed="true"/>
<xs:element name="Titre" type="Titre"/>
<xs:complexType name="Exp_prof">
<xs:sequence>
<xs:element ref="Entreprise"/>
<xs:element ref="Titre_position"/>
<xs:element ref="Pays"/>
<xs:element ref="region"/>
<xs:element ref="ville"/>
</xs:sequence>
<xs:attribute name="date" type="xs:anySimpleType"/>
</xs:complexType>
<xs:element name="Exp_prof" type="Exp_prof"/>
<xs:complexType name="Entreprise" mixed="true"/>
<xs:element name="Entreprise" type="Entreprise"/>
<xs:complexType name="Titre_position" mixed="true"/>
<xs:element name="Titre_position" type="Titre_position"/>
<xs:complexType name="Domaines_compet">
<xs:sequence>
<xs:element ref="Titre"/>
<xs:element ref="Experience"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Domaines_compet" type="Domaines_compet"/>
<xs:complexType name="Experience" mixed="true"/>
<xs:element name="Experience" type="Experience"/>
<xs:complexType name="Publications">
<xs:sequence>
<xs:element ref="Type_publication">
<xs:simpleType>
<xs:restriction base="xs:anySimpleType">
<xs:enumeration value="livre"/>
<xs:enumeration value="article"/>
<xs:enumeration value="cart_visite"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="Publications" type="Publications"/>
<xs:complexType name="Type_publication" mixed="true"/>
<xs:element name="Type_publication" type="Type_publication"/>
<xs:complexType name="honneur_recompense">
<xs:sequence>
<xs:element ref="Titre"/>
</xs:sequence>
<xs:attribute name="date" type="xs:anySimpleType"/>
</xs:complexType>
<xs:element name="honneur_recompense" type="honneur_recompense"/>
<xs:element name="Region"/>
<xs:element name="Niveau"/>
<xs:element name="Ville"/>
</xs:schema>
voici aussi cv.xsl:
<?xml version="1.0" encoding="UTF-8"?><!-- DWXMLSource="cv" -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>CV</title>
<style type='text/css'>
.cvhead
{
width:770px;
height :10px;
font-size: 10pt;
color: rgb(51, 51, 51);
font-weight:bold ;
background-color:#E2E2E2;
}
.cvhead_sub
{
width:770px;
height :10px;
font-size: 10pt;
color: rgb(51, 51, 51);
font-weight:bold ;
}
.disin
{
font-size: 16pt;
color: rgb(51, 51, 51);
font-family :Times New Roman;
width :20px;
}
.sumallheadtext
{
font-size: 8pt;
color: rgb(36, 64, 97);
font-weight :bold ;
text-align :left ;
vertical-align :top ;
}
.righttext
{
font-size: 8pt;
color: black;
font-family:Verdana ;
font-weight :normal;
text-align :left ;
vertical-align :top ;
}
</style>
</head>
<body style ='font-family :Arial; '>
<table align='center' border ='1' style ='border :1px; border-color :#F5F2DE; background-color:#FEFEFA;width :800px;'>
<tr>
<td align='center' >
<table align='center' style ='left:25px;'>
<tr >
<td align='center' style='font-size:2em;' >
<span style ='position :relative;top:10px;left:120px;color:Gray;'>Curriculum Vitae</span>
<span style =' position :relative;top:10px;left:-122px;color :#FF6600;'>Curriculum Vitae</span>
<br />
</td>
</tr>
</table>
<br/>
<table align='center' class='cvhead' >
<tr>
<td class ='disin'>*</td>
<td align='left' >Informations personnelles</td>
</tr>
</table>
<br />
<!-- 1-->
<xsl:for-each select="//cv/Info_perso">
<table align='center' class='cvhead_sub' >
<td width ='385' style='vertical-align :top;'>
<table width ='385' >
<tr>
<td style ='width:80px;' class ='sumallheadtext'>Nom : </td>
<td class='righttext'><xsl:value-of select="nom"/></td>
</tr>
<tr>
<td style ='width:80px;' class ='sumallheadtext'>Prénom : </td>
<td class='righttext'><xsl:value-of select="prenom"/></td>
</tr>
<tr>
<td style ='width:80px;' class ='sumallheadtext'>Alias : </td>
<td class='righttext'><xsl:value-of select="alias"/></td>
</tr>
<tr>
<td class ='sumallheadtext'>Email :</td>
<td class='righttext'><xsl:value-of select="Adresse_E-mail"/></td>
</tr>
<tr>
<td class ='sumallheadtext'>Age :</td>
<td class='righttext'><xsl:value-of select="age"/></td>
</tr>
<tr>
<td style ='width:80px;' class ='sumallheadtext'>Téléphone : </td>
<td class='righttext'><xsl:value-of select="Telephone"/></td>
</tr>
<tr>
<td align ='left' class ='sumallheadtext'>
Langue : <br />
<span class='righttext' >
<xsl:for-each select="Langue">
<xsl:value-of select="."/> <br />
</xsl:for-each>
</span>
</td>
</tr>
<tr>
<td style ='width:80px;' class ='sumallheadtext'>Sexe : </td>
<td class='righttext'><xsl:for-each select="sex"/>
<xsl:value-of select="."/> <br />
</xsl:for-each>
</td>
</tr>
</table>
<br />
<div align='center' style ='color: rgb(227, 108, 10);font-size:1.4em;' >* * * </div><br />
<table align='center' class='cvhead' >
<tr>
<td class ='disin'>*</td>
<td align='left' >Adresse</td>
</tr>
</table>
<br />
<!-- 1-->
<xsl:for-each select="//cv/adr">
<table align='center' class='cvhead_sub' >
<td width ='385' style='vertical-align :top;'>
<table width ='385' >
<tr>
<td style ='width:80px;' class ='sumallheadtext'>Ville : </td>
<td class='righttext'><xsl:value-of select="ville"/></td>
</tr>
<tr>
<td style ='width:80px;' class ='sumallheadtext'>Région : </td>
<td class='righttext'><xsl:value-of select="region"/></td>
</tr>
<tr>
<td style ='width:80px;' class ='sumallheadtext'>Pays : </td>
<td class='righttext'><xsl:value-of select="Pays"/></td>
</tr>
<tr>
<td class ='sumallheadtext'>Code postal :</td>
<td class='righttext'><xsl:value-of select="Code_postal"/>
</xsl:for-each></td>
</tr>
</table>
</td>
</table>
<br />
<div align='center' style ='color: rgb(227, 108, 10);font-size:1.4em;' >* * * </div><br />
<table align='center' class='cvhead' >
<tr>
<td class ='disin'>*</td>
<td align='left' >Formations</td>
</tr>
</table>
<br />
<!-- 1-->
<xsl:for-each select="//cv/Formations">
<table align='center' class='cvhead_sub' >
<tr>
<td class ='sumallheadtext'>1.<xsl:value-of select="Ecoles"/>
<span class='cvhead_sub' >(<xsl:value-of select="Date"/>)</span>
</td>
</tr>
</table>
<table width ='770' align ='center' >
<tr>
<td width ='385' style='vertical-align :top;'>
<table width ='385' >
<tr>
<td class ='sumallheadtext'>Titre :</td>
<td class='righttext'><xsl:value-of select="Titre"/> </td></tr>
<tr>
<td class ='sumallheadtext'>Niveau :</td>
<td class='righttext'><xsl:value-of select="Niveau"/>
</xsl:for-each></td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<div align='center' style ='color: rgb(227, 108, 10);font-size:1.4em;' >* * * </div><br />
<table align='center' class='cvhead' >
<tr>
<td class ='disin'>*</td>
<td align='left' >Expériences professionnelles</td>
</tr>
</table>
<br />
<!-- 1-->
<xsl:for-each select="//cv/Experience">
<table align='center' class='cvhead_sub' >
<tr>
<td class ='sumallheadtext'>1 . <xsl:value-of select="Entreprise"/>
<span class='cvhead_sub' >(<xsl:value-of select="Date"/>)</span>
</td>
</tr>
</table>
<table width ='770' align ='center' >
<tr>
<td width ='385' style='vertical-align :top;'>
<table width ='385' >
<tr>
<td class ='sumallheadtext'>Pays :</td>
<td class='righttext'><xsl:value-of select="Pays"/> </td></tr>
<tr>
<td class ='sumallheadtext'>Région :</td>
<td class='righttext'><xsl:value-of select="Region"/></td>
</tr>
<tr>
<td class ='sumallheadtext'>Ville :</td>
<td class='righttext'><xsl:value-of select="Ville"/></td>
</tr>
<tr>
<td class ='sumallheadtext'>Titre de position :</td>
<td class='righttext'><xsl:value-of select="Titre_position"/>
</xsl:for-each></td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<div align='center' style ='color: rgb(227, 108, 10);font-size:1.4em;' >* * * </div><br />
</table>
<!-- 1-->
<table align='center' class='cvhead' >
<tr>
<td class ='disin'>*</td><td align='left' >Domaines de compétences </td>
</tr>
</table>
<!-- 1-->
<br />
<!-- 2-->
<xsl:for-each select="//cv/Domaines_compet">
<table width ='770' align ='center' >
<tr>
<td width ='385' style='vertical-align :top;'>
<table width ='385' >
<tr>
<td class ='sumallheadtext'>Titre : </td>
<td class='righttext'><xsl:value-of select="Titre"/></td>
</tr>
<tr>
<td class ='sumallheadtext'> Experience :</td>
<td class='righttext'><xsl:value-of select="Experience"/>
</xsl:for-each></td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<div align='center' style ='color: rgb(227, 108, 10);font-size:1.4em;' >* * * </div>
<!-- 1-->
<br />
<table align='center' class='cvhead' >
<tr>
<td class ='disin'>*</td>
<td align='left' >Publications </td>
</tr>
</table>
<!-- 2-->
<br />
<xsl:for-each select="//cv/publications">
<!-- 3-->
<table width ='770' align ='center' >
<tr>
<td align ='left' class ='sumallheadtext'>
Type de publications : <br />
<span class='righttext' >
<xsl:for-each select="Type_publication">
- <xsl:value-of select="."/> <br />
</xsl:for-each> </span>
</td>
</tr>
</table>
<br />
<div align='center' style ='color: rgb(227, 108, 10);font-size:1.4em;' >* * * </div><br />
<!-- 3-->
</xsl:for-each>
<br />
<table align='center' class='cvhead' >
<tr>
<td class ='disin'>*</td>
<td align='left' >Honneur/Recompences </td>
</tr>
</table>
<br />
<xsl:for-each select="//cv/honneur_recompense">
<!-- 4-->
<table width ='770' align ='center' >
<tr>
<td width ='385' style='vertical-align :top;'>
<table width ='385' >
<tr>
<td style ='width:80px;' class ='sumallheadtext'> Region :</td>
<td class='righttext'><xsl:value-of select="Region"/></td>
</tr>
<tr>
<td style ='width:80px;' class ='sumallheadtext'> Niveau :</td>
<td class='righttext'><xsl:value-of select="Niveau"/></td>
</tr>
<tr>
<td style ='width:80px;' class ='sumallheadtext'> Ville :</td>
<td class='righttext'><xsl:value-of select="Ville"/>
</xsl:for-each></td>
</tr>
</table>
</td>
</tr>
</table>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
voici le fichier cv.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<CV>
<information_personnelle>
<Nom>kjldjgtm</Nom>
<prenom>jglhjm</prenom>
<date_de_naissance>
<jour>01</jour>
<mois>01</mois>
<annee>1950</annee>
</date_de_naissance>
<Nationalite>Belge</Nationalite>
</information_personnelle>
<Adresse>
<ville>ijoh</ville>
<code_postal>3546</code_postal>
<Region>GNJH</Region>
<pays>JJH</pays>
</Adresse>
<Communication>
<email>naji_sihem@yahoo.fr </email>
<Telephone>7487689</Telephone>
<GSM>8679</GSM>
</Communication>
<Formations>
<Ecoles>JLTJ</Ecoles>
<Titre>RJGLD</Titre>
<Niveau>JJF</Niveau>
<date_formation>10/10/2004</date_formation>
</Formations>
<Connaissance_des_langues>
<Francais>
<ecritfr>ecrit</ecritfr>
</Francais>
<Anglais>
<oralan>oral</oralan>
</Anglais>
</Connaissance_des_langues>
<Experience_professionel>
<entreprise>HJKFGL</entreprise>
<titre_position>IJGLT</titre_position>
<pays>JJH</pays>
<date_experience>12/12/2006</date_experience>
</Experience_professionel>
<Domaines_de_competence>
<titre>RJGLD</titre>
<experience>JGF</experience>
</Domaines_de_competence>
<Publications>
<type_publication>Livre</type_publication>
</Publications>
<honneur_recompense>
<titre>RJGLD</titre>
<date_honneur>11/02/2007</date_honneur>
</honneur_recompense>
</CV>
c'est urgent svp aidez moi et merci d'avance