/** * Serialize this node into the writer as XML. * The specified Map associates prefixes with namespace URLs. */ public static void serializeAsXML(Node node, Map namespaces, Writer writer) { ObjectRegistry namespaceStack = new ObjectRegistry(namespaces); namespaceStack.register("xml", NS_URI_XML); PrintWriter pw = new PrintWriter(writer); String javaEncoding = (writer instanceof OutputStreamWriter) ? ((OutputStreamWriter) writer).getEncoding() : null; print(node, namespaceStack, pw, java2XMLEncoding(javaEncoding)); }
/** * Serialize this node into the writer as XML. * The specified Map associates prefixes with namespace URLs. */ public static void serializeAsXML(Node node, Map namespaces, Writer writer) { ObjectRegistry namespaceStack = new ObjectRegistry(namespaces); namespaceStack.register("xml", NS_URI_XML); PrintWriter pw = new PrintWriter(writer); String javaEncoding = (writer instanceof OutputStreamWriter) ? ((OutputStreamWriter) writer).getEncoding() : null; print(node, namespaceStack, pw, java2XMLEncoding(javaEncoding)); }