I am using the Java Transformer class to process an XML document object.
This is the code that Transformer creates:
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "no");
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.transform(source, result);
Currently, my output is as follows: <svg ... />. I would like it to include the namespace of each element, as in <svg: svg ... />
How can i do this?
source
share