Bonjour à tous,
C'est mon 1er message sur ce forum, je fais appel aux érudits du xsl ;
Ma demande concerne un regroupement d'une structure xml qui se répète, en 1 seule structure.
Xml d'entrée :
J'ai donc en entrée, 3 fois la même structure "version_arch"
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197 <?xml version="1.0" encoding="UTF-8"?> <document> <archive> <version_arch date="20091015" id="1"> <metadata> <model>advice</model> </metadata> <content> <fr> <title>title version 1</title> <short_title>short title version 1</short_title> <situation> <html> <body> <p>situation version 1</p> </body> </html> </situation> <opinion> <html> <body> <p>avis version 1</p> </body> </html> </opinion> <justification> <html> <body> <p>justification version 1</p> </body> </html> </justification> </fr> <nl> <title>title nl version 1</title> <short_title>short title nl version 1</short_title> <situation> <html> <body> <p>situation nl version 1</p> </body> </html> </situation> <opinion> <html> <body> <p>avis nl version 1</p> </body> </html> </opinion> <justification> <html> <body> <p>justification nl version 1</p> </body> </html> </justification> </nl> <de> <title/> <short_title/> <situation/> <opinion/> <justification/> </de> </content> </version_arch> <version_arch date="20091015" id="2"> <metadata> <model>advice</model> </metadata> <content> <fr> <title>title version 2</title> <short_title>short title version 2</short_title> <situation> <html> <body> <p>situationversion 2</p> </body> </html> </situation> <opinion> <html> <body> <p>avis version 2</p> </body> </html> </opinion> <justification> <html> <body> <p>justification version 2</p> </body> </html> </justification> </fr> <nl> <title>title nl version 2</title> <short_title>short title nl version 2</short_title> <situation> <html> <body> <p>situation nlversion 2</p> </body> </html> </situation> <opinion> <html> <body> <p>avis nl version 2</p> </body> </html> </opinion> <justification> <html> <body> <p>justification nl version 2</p> </body> </html> </justification> </nl> <de> <title/> <short_title/> <situation/> <opinion/> <justification/> </de> </content> </version_arch> <version_arch date="20091015" id="3"> <metadata> <model>advice</model> </metadata> <content> <fr> <title>title version 3</title> <short_title>short title version 3</short_title> <situation> <html> <body> <p>situation version 3</p> </body> </html> </situation> <opinion> <html> <body> <p>avis version 3</p> </body> </html> </opinion> <justification> <html> <body> <p>justification version 3</p> </body> </html> </justification> </fr> <nl> <title>title nl version 3</title> <short_title>short title nl version 3</short_title> <situation> <html> <body> <p>situation nl version 3</p> </body> </html> </situation> <opinion> <html> <body> <p>avis nl version 3</p> </body> </html> </opinion> <justification> <html> <body> <p>justification nl version 3</p> </body> </html> </justification> </nl> <de> <title/> <short_title/> <situation/> <opinion/> <justification/> </de> </content> </version_arch> </archive> </document>
Xml de sortie souhaité :
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 <?xml version="1.0" encoding="utf-8"?> <document> <editing> <metadata> <model>advice</model> </metadata> <content> <fr> <title>title version 1</title> <title>title version 2</title> <title>title version 3</title> <short_title>short title version 1</short_title> <short_title>short title version 2</short_title> <short_title>short title version 3</short_title> <situation> <html> <body> <p>situationversion 1</p> </body> </html> </situation> <situation> <html> <body> <p>situationversion 2</p> </body> </html> </situation> <situation> <html> <body> <p>situationversion 3</p> </body> </html> </situation> <opinion> <html> <body> <p>avis version 1</p> </body> </html> </opinion> <opinion> <html> <body> <p>avis version 2</p> </body> </html> </opinion> <opinion> <html> <body> <p>avis version 3</p> </body> </html> </opinion> <justification> <html> <body> <p>justification version 1</p> </body> </html> </justification> <justification> <html> <body> <p>justification version 2</p> </body> </html> </justification> <justification> <html> <body> <p>justification version 3</p> </body> </html> </justification> </fr> <nl> [...] </nl> <de> [...] </de> </content> </editing> </document>
Je dois donc regrouper en 1 structure, ce qui se trouve dans <content>. Je suis conscient que cette "structure" n'est pas ce qu'il y'a de mieux, mais des contraintes m'empêchent de faire autrement.
N'hésitez-pas si vous voulez plus d'infos.
Tout conseil, astuce sont bienvenus, et je vous en remercie d'avance
Partager