Bonjour pour tous,
Mon but est de créer un code Java qui permet de changer les valeurs des attributs d’un fichier XML.
Au debut mon fichier XML est le suivant :
Pour changer les valeurs des attributs longueur , largeur , abscisse , ordonnée , j’ai utilisé cette fonction :
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
6
Alors maintenant mon fichier XML est le suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
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
Dans ce cas, j’ai un problème : Comment je peux changer les attributs d’une interface spécifique ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
6
7
8
9
10
11
12
Alors j’ai commencé par le parcours du document jusqu’à que je trouve l’interface désirée. Mais je n’ai pas pu changer les valeurs de ses attributs. L’exécution du code a provoqué des erreurs que je n’ai pas pu les corrigées.
Voici la fonction utilisée :
Voici les erreurs :
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
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
S’il vous plait aider moi à résoudre ce problème. Et merci.java.lang.NullPointerException
at XMLReadWrite.xmlOutputWrite(XMLReadWrite.java:590)
at fermer.windowClosing(Magic_Med.java:384)
at java.awt.Window.processWindowEvent(Window.java:1121)
at javax.swing.JFrame.processWindowEvent(JFrame.java:266)
at java.awt.Window.processEvent(Window.java:1079)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

 

 
		
		 
        

 
			
			




 changer les valeurs des attributs d'un fichier XML
 changer les valeurs des attributs d'un fichier XML
				 Répondre avec citation
  Répondre avec citation
Partager