bonjour,
je veux extraire du texte d'un fichier source et modifier la valeur d'un attribut, en utilisant ce text, dans un fichier destination.
la locaalisation de mon text et l'extraction fonctionne bien.
Cependant au lieux d'avoir un text pour chaque noeud, j'aurais tous les text pour tout les noeud .
j'arrive pas a resoudre le pb.
votre aide est apprecier
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
27
28
29
30
31
32
33
34
35
36
37
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
	xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint">
	<xsl:output method="xml" encoding="UTF-8" indent="yes" />
 
	<xsl:template match="/|node() | @*">
		<xsl:copy>
			<xsl:apply-templates select="node()|@*" />
		</xsl:copy>
	</xsl:template>
	<xsl:template name="doIt">
		<xsl:call-template name="repeat" />
	</xsl:template>
 
	<xsl:template match="w:binData/@w:name" name="repeat">
 
		<!--debut traitement -->
		<xsl:for-each
			select="//w:p[descendant::w:binData and preceding-sibling::w:p[1][descendant::w:t[contains(.,'Figure')]]]">
			<xsl:apply-templates select="./w:binData[position()]/@w:name" />
 
			position vaut
			<xsl:value-of select=" position() " />
 
			<xsl:for-each
				select="./preceding-sibling::w:p[1][descendant::w:t[contains(.,'Figure')]]//w:t">
 
				<xsl:value-of select="." />
			</xsl:for-each>
 
		</xsl:for-each>
 
		<!--fin traitement -->
	</xsl:template>
</xsl:stylesheet>
merci