Hi everybody,
I am modifying an xml file and when I'm saving it
standalone attribute apears in xml declaration.
The original xml has the declaration like this:
<?xml version="1.0" encoding="UTF-8"?>
The new xml declaration is:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Java code looks like this:
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.METHOD,"xml");
StreamResult output = new StreamResult(new FileWriter(file));
DOMSource source = new DOMSource(workDocument);
transformer.transform(source, output);
output.getWriter().flush();
output.getWriter().close();
I am using Java 1.6.0.13
Is there any way to remove standalone attribute?