Hi all,

I am trying to write a Document to an OutputStream with the following code:

TransformerFactory factory = TransformerFactory.newInstance();

Transformer transformer = factory .newTransformer();

Properties properties = new Properties();

properties.setProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");

properties.setProperty(OutputKeys.INDENT, "yes");

transformer.setOutputProperties(properties);

DOMSource source = new DOMSource(doc);

StreamResult result = new StreamResult(output);

transformer.transform(source, result);

and I am getting the following result:

<a xmlns="">

    <b xmlns=""/>

</a>

How do I avoid the "xmlns" attributes?

I would appreciate any assistance,

Marcelo.



Internet GRATIS es Yahoo! Conexión.
Usuario: yahoo; contraseña: yahoo
Desde Buenos Aires: 4004-1010
Más ciudades: clic aquí.