After creating XML with DOM the header includes UTF-8 ?

teamfnd

New Member
I need to create an XML file using DOM under Eclipse (for Java) and using the following code : \[code\] // write the content into xml file TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(new File("output.xml")); transformer.transform(source, result);\[/code\]My XML's first line is :\[code\]<?xml version="1.0" encoding="UTF-8"?>\[/code\]and not :\[code\]<?xml version="1.0"?>\[/code\]My questions are : [*]What is the difference between those two declarations ? [*]How can I generate the XML file using the header : \[code\]<?xml version="1.0"?>\[/code\]Regards
 
Back
Top