Bonjour,
Je souhaite faire une transformation xml/xslt mais je recontre un problème de namespace. Dans le xml que je reçois (un xml d'un dataset en .NET), il y a un namespace renseigné :
Dans mon fichier xslt j'ai renseigné ce même namespace avec un prefix :
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 <RecoCampagneDS xmlns="http://tempuri.org/RecoCampagneDS.xsd"> <OLCONTRAINTES> <CODCONTRAINTE>1</CODCONTRAINTE> <LBCONTRAINTE>affichage grand format</LBCONTRAINTE> <CODSSUNIV>1</CODSSUNIV> <NBTRI>1</NBTRI> <FLACTIF>1</FLACTIF> <NBGROUPE>1</NBGROUPE> <CODCAMPAGNE>8</CODCAMPAGNE> </OLCONTRAINTES> <OLCONTRAINTES> <CODCONTRAINTE>2</CODCONTRAINTE> <LBCONTRAINTE>affichage bus</LBCONTRAINTE> <CODSSUNIV>3</CODSSUNIV> <NBTRI>2</NBTRI> ...
Un peu plus bas dans mon xslt j'ai renseigné mes "select" avec ce préfix :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pref="http://tempuri.org/RecoCampagneDS.xsd" exclude-result-prefixes="pref"> <xsl:output method="html"/> <xsl:template match="/"> <html> <head> <title>Impression</title> ....
Mais évidement cela ne fonctionne pas. Est ce que quelqu'un peut m'aider?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 <xsl:for-each select="pref:RecoCampagneDS/INFOSCAMPAGNE"> <tr> <td class="IntituleLabel" align="right">Campagne</td> <td align="center"></td> <td class="NormalBoldBlack" colspan="4"><xsl:value-of select="pref:NomCampagne"/></td> </tr> <tr> ...
Partager