/** * Writes a node using the given writer. */ public static void writeNode(Node n, Writer w) throws IOException { if (n.getNodeType() == Node.DOCUMENT_NODE) { writeDocument((Document) n, w); } else { AbstractDocument d = (AbstractDocument) n.getOwnerDocument(); writeNode(n, w, NSMap.create(), d == null ? false : "1.1".equals(d.getXmlVersion())); } }
/** * Writes a node using the given writer. */ public static void writeNode(Node n, Writer w) throws IOException { if (n.getNodeType() == Node.DOCUMENT_NODE) { writeDocument((Document) n, w); } else { AbstractDocument d = (AbstractDocument) n.getOwnerDocument(); writeNode(n, w, NSMap.create(), d == null ? false : "1.1".equals(d.getXmlVersion())); } }
/** * Writes a node using the given writer. */ public static void writeNode(Node n, Writer w) throws IOException { if (n.getNodeType() == Node.DOCUMENT_NODE) { writeDocument((Document) n, w); } else { AbstractDocument d = (AbstractDocument) n.getOwnerDocument(); writeNode(n, w, NSMap.create(), d == null ? false : "1.1".equals(d.getXmlVersion())); } }
/** * Transcodes the specified input in the specified output. * @param input the input to transcode * @param output the ouput where to transcode * @exception TranscoderException if an error occured while transcoding */ public void transcode(TranscoderInput input, TranscoderOutput output) throws TranscoderException { Reader r = input.getReader(); Writer w = output.getWriter(); if (r == null) { Document d = input.getDocument(); if (d == null) { throw new Error("Reader or Document expected"); } StringWriter sw = new StringWriter( 1024 ); try { DOMUtilities.writeDocument(d, sw); } catch ( IOException ioEx ) { throw new Error("IO:" + ioEx.getMessage() ); } r = new StringReader(sw.toString()); } if (w == null) { throw new Error("Writer expected"); } prettyPrint(r, w); }
/** * Transcodes the specified input in the specified output. * @param input the input to transcode * @param output the ouput where to transcode * @exception TranscoderException if an error occured while transcoding */ public void transcode(TranscoderInput input, TranscoderOutput output) throws TranscoderException { Reader r = input.getReader(); Writer w = output.getWriter(); if (r == null) { Document d = input.getDocument(); if (d == null) { throw new RuntimeException("Reader or Document expected"); } StringWriter sw = new StringWriter( 1024 ); try { DOMUtilities.writeDocument(d, sw); } catch ( IOException ioEx ) { throw new RuntimeException("IO:" + ioEx.getMessage() ); } r = new StringReader(sw.toString()); } if (w == null) { throw new RuntimeException("Writer expected"); } prettyPrint(r, w); }
new TranscoderOutput(writer)); } else { DOMUtilities.writeDocument(svgDoc, writer);
new TranscoderOutput(writer)); } else { DOMUtilities.writeDocument(svgDoc, writer);