Salut tout le monde,
J'ai du mal aujourdhui avec xpath
un petit exemple
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 <?xml version="1.0" encoding="windows-1252"?> <html> <head> </head> <body> <table> <tbody> <tr> <td> Text à recupérer </td> </tr> </tbody> </table> </body> </html>
Avec le xsl suivant
aucun resultat avec le chemin
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 <?xml version="1.0" encoding="windows-1252"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <xsl:output method="xml" indent="yes" encoding="windows-1252"/> <xsl:template match="/"> <doc> <xsl:apply-templates select="//xhtml:table[1]"/> </doc> </xsl:template> <!-- titre --> <xsl:template match="//xhtml:table[1]//xhtml:td"> <xsl:element name="text"> <xsl:attribute name="titre"> <xsl:value-of select="."/> </xsl:attribute> </xsl:element> </xsl:template> </xsl:stylesheet>
<xsl:apply-templates select="//xhtml:table[1]"/>
[1]-->parceque j'ai plusieures table dans ma source d'origine
avec * ça marche mais pourquoi ce chemin ne fonctionne pas
merci pour votre aide
Partager