Bonjour,

J'aurais quelques petites questions à ce sujet (cf. discussion : http://www.developpez.net/forums/d11...iers-xml-java/ )

Si le fichier est balisé de la sorte, je me retrouve effectivement, en suivant la procédure citée ci-dessus, avec la balise <Document> présente deux fois, ce qui évidement rend le fichier fichier final inexploitable.

Quelle approche je peux adopter dans ce cas là ?

Code KML1 : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
	<Document>
		<name>File1</name>
		<description><![CDATA[Created on 6/7/2012 at 1:18 AM]]></description>
		<Placemark>
			<name>Test</name>
			<Point>
				<coordinates>-0.673017,44.872883,0</coordinates>
			</Point>
			<visibility>1</visibility>
		</Placemark>
	</Document>
</kml>
Code KML2 : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
	<Document>
		<name>File2</name>
		<description><![CDATA[Created on 6/7/2012 at 1:18 AM]]></description>
		<Placemark>
			<name>Test2</name>
			<Point>
				<coordinates>-0.673017,44.872883,0</coordinates>
			</Point>
			<visibility>1</visibility>
		</Placemark>
	</Document>
</kml>
Code FINAL : 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
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
	<Document>
		<name>File1</name>
		<description><![CDATA[Created on 6/7/2012 at 1:18 AM]]></description>
		<Placemark>
			<name>Test</name>
			<Point>
				<coordinates>-0.673017,44.872883,0</coordinates>
			</Point>
			<visibility>1</visibility>
		</Placemark>
	</Document>
	<Document>
		<name>File2</name>
		<description><![CDATA[Created on 6/7/2012 at 1:18 AM]]></description>
		<Placemark>
			<name>Test2</name>
			<Point>
				<coordinates>-0.673017,44.872883,0</coordinates>
			</Point>
			<visibility>1</visibility>
		</Placemark>
	</Document>
</kml>