Bonjour,

y a t'il moyen avec STAX d'indenter un ficher XML. Le mein ressemble à ça et c'est pas très joli
Code : Sélectionner tout - Visualiser dans une fenêtre à part
<?xml version="1.0" encoding="UTF-8"?><?xml version="1.0" ?><enquiry xmlns:dtl="http://datalion.eu"></enquiry>
voic le bout de code qui me sert à créer ce fichier
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
public void write()
	{
		XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
		try
		{
			this.output = new FileOutputStream(URL);
			this.writer = outputFactory.createXMLStreamWriter(output);
			this.writer.writeStartDocument(this.ENCODING, this.VERSION);
			this.writer.writeStartDocument();
			this.writer.setPrefix("tns",this.NS);
			this.writer.setDefaultNamespace(this.NS);
			this.writer.writeStartElement(this.NS,"enquiry");
			this.writer.writeNamespace("dtl",this.NS);
			this.writer.writeEndElement();
		}
		catch(XMLStreamException e1)
		{
			System.out.println("XMLStreamException");
			e1.printStackTrace();
		}
		catch(IOException e2)
		{
			System.out.println("File not found");
			e2.printStackTrace();
		}
	}