bonjour,
je souhaite créer une page à partir de 2 fichiers XML ,
je m'explique :
j'ai un fichier Categorie.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 <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="C:\exec\trans.xslt"?> <Categories> <Categorie ref="1"> <nom>Cat1</nom> </Categorie> <Categorie ref="2"> <nom>Cat2</nom> </Categorie> <Categorie ref="3"> <nom>Cat3</nom> </Categorie> </Categories>
puis le fichier produit.xml :
la balise catRef fait la référence vers l'attribut ref d'une catégorie.
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 <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="C:\exec\trans.xslt"?> <produits> <produit ref="1"> <nom>Prod1</nom> <prix>100</prix> <catRef>1</catRef> </produit> <produit ref="2"> <nom>Prod2</nom> <prix>200</prix> <catRef>1</catRef> </produit> <produit ref="3"> <nom>Prod3</nom> <prix>300</prix> <catRef>2</catRef> </produit> </produits>
donc je souhaite afficher les produits avec leurs nom de catégories à l'aide d'un fichier XSLT est ce possible ? et comment ?
merci d'avance.
Partager