Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JBrowser Source Code Files
JBrowser Source Code Files are provided in the
source package file.
You can download JBrowser source package as described in the previous tutorial and go to the "src" sub-folder to view Source Code files.
You can also browse JBrowser Source Code files below:
✍: FYIcenter
⏎ org/mozilla/browser/impl/DOMUtils.java
package org.mozilla.browser.impl; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.StringWriter; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.w3c.dom.Document; import org.w3c.dom.Node; /** * utility functions for DOM manipulation */ public class DOMUtils { public static void writeDOMToFile(Document doc, File f) throws IOException { OutputStream os = null; try { os = new BufferedOutputStream(new FileOutputStream(f)); writeDOMToStream(doc, os); } finally { if (os!=null) os.close(); } } public static String writeDOMToString(Document doc) { try { StringWriter w = new StringWriter(); try { StreamResult sr = new StreamResult(w); writeDOMToSource(doc, sr, "UTF-8"); //$NON-NLS-1$ return w.toString(); } finally { if (w!=null) w.close(); } } catch (IOException e) { throw new RuntimeException(e); } } public static String writeDOMToString(Node n) { try { StringWriter w = new StringWriter(); try { StreamResult sr = new StreamResult(w); writeDOMToSource(n, sr, "UTF-8"); //$NON-NLS-1$ return w.toString(); } finally { if (w!=null) w.close(); } } catch (IOException e) { throw new RuntimeException(e); } } public static void writeDOMToStream(Document doc, OutputStream os) throws IOException { writeDOMToStream(doc, os, "UTF-8"); //$NON-NLS-1$ } public static void writeDOMToStream(Node n, OutputStream os) throws IOException { StreamResult sr = new StreamResult(os); writeDOMToSource(n, sr, "UTF-8"); //$NON-NLS-1$ } public static void writeDOMToStream(Document doc, OutputStream os, String encoding) throws IOException { StreamResult sr = new StreamResult(os); writeDOMToSource(doc, sr, encoding); } public static void writeDOMToSource(Node n, StreamResult sr, String encoding) throws IOException { try { //create transformer TransformerFactory trf = TransformerFactory.newInstance(); Transformer tr = trf.newTransformer(); tr.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ tr.setOutputProperty(OutputKeys.ENCODING, encoding); tr.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ //serialize DOM tr.transform(new DOMSource(n), sr); } catch (TransformerException e) { //wrap to IOException IOException ioe = new IOException(); ioe.initCause(e); throw ioe; } } }
⏎ org/mozilla/browser/impl/DOMUtils.java
Or download all of them as a single archive file:
File name: jbrowser-1.9-fyi.zip File size: 625318 bytes Release date: 2022-11-10 Download
⇐ Download and Install JBrowser Source Package
2017-07-17, 9309👍, 1💬
Popular Posts:
What Is mail.jar of JavaMail 1.4.2? I got the JAR file from javamail-1.4.2.zip. mail.jar in javamail...
Apache Axis2 is the core engine for Web services. It is a complete re-design and re-write of the wid...
How to download and install ojdbc7.jar for Oracle 12c R1? ojdbc8.jar for Oracle 12c R1 is a Java 7 a...
What Is fop.jar? I got it from the fop-2.7-bin.zip. fop.jar in fop-2.7-bin.zip is the JAR file for F...
maven-settings-builder-3 .8.6.jaris the JAR file for Apache Maven 3.8.6 Settings Builder module. Apa...