Bonjour,

je dois splitter un document xml en plusieurs, en gardant le balise racine dans chaque fois, exemple :

xml entré :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
<?xml version="1.0" encoding="UTF-8"?>
<Export xmlns:ns1="http://www" xmlns:xsi="http://www.w3.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/"> 
   <record>
	<field name="Candidate,FirstName" >dodo1</field>
	<field name="Candidate,LastName" >didi1</field>
   </record>
   <record>
	<field name="Candidate,FirstName" >dodo2</field>
	<field name="Candidate,LastName" >didi2</field>
    </record>
</Export>
sortie :
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
 
1- 
<?xml version="1.0" encoding="UTF-8"?>
<Export xmlns:ns1="http://www" xmlns:xsi="http://www.w3.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/"> 
   <record>
	<field name="Candidate,FirstName" >dodo1</field>
	<field name="Candidate,LastName" >didi1</field>
   </record>
</Export>
 
2-
<?xml version="1.0" encoding="UTF-8"?>
<Export xmlns:ns1="http://www" xmlns:xsi="http://www.w3.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/"> 
   <record>
	<field name="Candidate,FirstName" >dodo2</field>
	<field name="Candidate,LastName" >didi2</field>
   </record>
</Export>
Avez vous un code qui peur faire ça ?

Merci par avance