bonjour à tous,
Voilà je cherche à modifier un document XML à partir de perl.
C'est à dire que j'ai ceci dans le document 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
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
198
199
200
201
202
203
$VAR1 = {
          'xmlns:office' => 'http://openoffice.org/2000/office',
          'office:version' => '1.0',
          'office:class' => 'text',
          'xmlns:number' => 'http://openoffice.org/2000/datastyle',
          'xmlns:math' => 'http://www.w3.org/1998/Math/MathML',
          'xmlns:xlink' => 'http://www.w3.org/1999/xlink',
          'office:automatic-styles' => {« ensemble des styles de mise en forme »},
          'xmlns:form' => 'http://openoffice.org/2000/form',
          'xmlns:table' => 'http://openoffice.org/2000/table',
          'xmlns:style' => 'http://openoffice.org/2000/style',
          'office:font-decls' => {« mis en forme des styles d'écritures »},
          'xmlns:script' => 'http://openoffice.org/2000/script',
          'office:body' => {
                           'draw:text-box' => {
                                              'draw:z-index' => '0',
                                              'svg:y' => '6.151cm',
                                              'text:anchor-page-number' => '1',
                                              'draw:style-name' => 'fr1',
                                              'text:p' => [
                                                          {
                                                            'text:style-name' => 'P1',
                                                            'content' => "Sociétés"
                                                          },
                                                          {
                                                            'text:style-name' => 'P2'
                                                          },
                                                          {
                                                            'text:style-name' => 'P3',
                                                            'content' => '<Nom de la Division>'
                                                          },
                                                          {
                                                            'text:style-name' => 'P3'
                                                          },
                                                          {
                                                            'text:style-name' => 'P3'
                                                          },
                                                          {
                                                            'text:style-name' => 'P3'
                                                          },
                                                          {
                                                            'text:style-name' => 'P3',
                                                            'content' => "<N\x{b0} \x{e9}ventuel du bureau>"
                                                          },
                                                          {
                                                            'text:style-name' => 'P3',
                                                            'content' => "<Intitul\x{e9} du bureau>"
                                                          },
                                                          {
                                                            'text:style-name' => 'P4'
                                                          },
                                                          {
                                                            'text:style-name' => 'P4',
                                                            'content' => 'Dossier suivi par'
                                                          },
                                                          {
                                                            'text:style-name' => 'P4',
                                                            'content' => "<Pr\x{e9}nom> <Nom>"
                                                          },
                                                          {
                                                            'text:style-name' => 'P4'
                                                          },
                                                          {
                                                            'text:style-name' => 'P4'
                                                          },
                                                          {
                                                            'text:style-name' => 'P4',
                                                            'content' => "T\x{e9}l\x{e9}phone"
                                                          },
                                                          {
                                                            'text:style-name' => 'P4',
                                                            'content' => '03 21 <00 00 00>'
                                                          },
                                                          {
                                                            'text:style-name' => 'P4'
                                                          },
                                                          {
                                                            'text:style-name' => 'P4',
                                                            'content' => "T\x{e9}l\x{e9}copie"
                                                          },
                                                          {
                                                            'text:style-name' => 'P4',
                                                            'content' => '03 21 <00 00 00>'
                                                          },
                                                          {
                                                            'text:style-name' => 'P4'
                                                          },
                                                          {
                                                            'text:style-name' => 'P4',
                                                            'content' => "M\x{e9}l :"
                                                          },
                                                          {
                                                            'text:style-name' => 'P4',
                                                            'content' => "ce.<m\x{e9}l>\@machin.fr"
                                                          },
                                                          {
                                                            'text:style-name' => 'P4'
                                                          },
                                                          {
                                                            'text:style-name' => 'P3',
                                                            'content' => "rue"
                                                          },
                                                          {
                                                            'text:style-name' => 'P3',
                                                            'content' => 'Sac Postal 16'
                                                          },
                                                          {
                                                            'text:style-name' => 'P3',
                                                            'content' => 'CP+Ville'
                                                          },
                                                          {
                                                            'text:style-name' => 'P4'
                                                          },
                                                          {
                                                            'text:style-name' => 'P4'
                                                          }
                                                        ],
                                              'draw:name' => 'Cadre4',
                                              'svg:x' => '2.499cm',
                                              'svg:width' => '3.3cm',
                                              'svg:height' => '11.539cm',
                                              'text:anchor-type' => 'page'
                                            },
                           'text:p' => {
                                       'text:style-name' => 'P5'
                                     },
                           'draw:image' => [
                                           {
                                             'draw:z-index' => '2',
                                             'xlink:actuate' => 'onLoad',
                                             'svg:y' => '0.503cm',
                                             'text:anchor-page-number' => '1',
                                             'draw:style-name' => 'fr2',
                                             'draw:name' => 'Image2',
                                             'svg:x' => '9.405cm',
                                             'xlink:show' => 'embed',
                                             'xlink:href' => '#Pictures/2000000D00000EE3000009B88B14F2A9.svm',
                                             'svg:width' => '3.812cm',
                                             'svg:height' => '2.489cm',
                                             'xlink:type' => 'simple',
                                             'text:anchor-type' => 'page'
                                           },
                                           {
                                             'draw:z-index' => '1',
                                             'xlink:actuate' => 'onLoad',
                                             'svg:y' => '27.66cm',
                                             'text:anchor-page-number' => '1',
                                             'draw:style-name' => 'fr3',
                                             'draw:name' => 'Image3',
                                             'svg:x' => '2.499cm',
                                             'xlink:show' => 'embed',
                                             'xlink:href' => '#Pictures/2000000D0000082D0000052CD38558DC.svm',
                                             'svg:width' => '2.094cm',
                                             'svg:height' => '1.325cm',
                                             'xlink:type' => 'simple',
                                             'text:anchor-type' => 'page'
                                           },
                                           {
                                             'draw:z-index' => '3',
                                             'xlink:actuate' => 'onLoad',
                                             'svg:y' => '3.2cm',
                                             'text:anchor-page-number' => '1',
                                             'draw:style-name' => 'fr4',
                                             'draw:name' => 'Image1',
                                             'svg:x' => '0.499cm',
                                             'xlink:show' => 'embed',
                                             'xlink:href' => '#Pictures/100000000000007B0000005CE90D3BBD.tif',
                                             'svg:width' => '3cm',
                                             'svg:height' => '2.24cm',
                                             'xlink:type' => 'simple',
                                             'text:anchor-type' => 'page'
                                           }
                                         ],
                           'text:sequence-decls' => {
                                                    'text:sequence-decl' => [
                                                                            {
                                                                              'text:name' => 'Illustration',
                                                                              'text:display-outline-level' => '0'
                                                                            },
                                                                            {
                                                                              'text:name' => 'Table',
                                                                              'text:display-outline-level' => '0'
                                                                            },
                                                                            {
                                                                              'text:name' => 'Text',
                                                                              'text:display-outline-level' => '0'
                                                                            },
                                                                            {
                                                                              'text:name' => 'Drawing',
                                                                              'text:display-outline-level' => '0'
                                                                            }
                                                                          ]
                                                  }
                         },
          'office:script' => {},
          'xmlns:draw' => 'http://openoffice.org/2000/drawing',
          'xmlns:svg' => 'http://www.w3.org/2000/svg',
          'xmlns:fo' => 'http://www.w3.org/1999/XSL/Format',
          'xmlns:text' => 'http://openoffice.org/2000/text',
          'xmlns:dr3d' => 'http://openoffice.org/2000/dr3d',
          'xmlns:chart' => 'http://openoffice.org/2000/chart'
        };

Et j'aimerai modifier le contenu orange avec mon appli. Donc j'ai déjà fait ce genre de chose mais en vain, ou es ce que je suis loin de la vérité?..

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
if($res = $data->{office}->{draw}->{text}->{content}){
	print $res,"\n ";
	print "\n trouvé :-) \n ";
}else{
	print "\n pas trouvé :-( \n ";
}
Je rappel ceci est une version test ^^

Je vous remercie d'avance pour les réponses que vous me mettrez