Here you can find the source of writeXMLwithXALAN(final Writer writer, final Node node, final String xmlEncoding)
private static void writeXMLwithXALAN(final Writer writer, final Node node, final String xmlEncoding)
//package com.java2s; /* Copyright (C) 2011 [Gobierno de Espana] * This file is part of "Cliente @Firma". * "Cliente @Firma" is free software; you can redistribute it and/or modify it under the terms of: * - the GNU General Public License as published by the Free Software Foundation; * either version 2 of the License, or (at your option) any later version. * - or The European Software License; either version 1.1 or (at your option) any later version. * Date: 11/01/11/* w w w .j a va 2s . c o m*/ * You may contact the copyright holder at: soporte.afirma5@mpt.es */ import java.io.Writer; import org.w3c.dom.Node; import org.w3c.dom.ls.DOMImplementationLS; import org.w3c.dom.ls.LSSerializer; public class Main { private static void writeXMLwithXALAN(final Writer writer, final Node node, final String xmlEncoding) { final LSSerializer serializer = ((DOMImplementationLS) node.getOwnerDocument().getImplementation()) .createLSSerializer(); serializer.getDomConfig().setParameter("namespaces", Boolean.FALSE); //$NON-NLS-1$ final com.sun.org.apache.xerces.internal.dom.DOMOutputImpl output = new com.sun.org.apache.xerces.internal.dom.DOMOutputImpl(); output.setCharacterStream(writer); if (xmlEncoding != null) { output.setEncoding(xmlEncoding); } serializer.write(node, output); } }