public class SafeSAXReader extends Object
Credit due : http://asfak.wordpress.com/2009/08/29/escaping-or-unescaping-special- characters-while-writing-xml-files-using-dom4j/
| Constructor and Description |
|---|
SafeSAXReader()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
docToStream(org.dom4j.Node outDoc,
OutputStream outStream)
Convert node to stream
|
String |
docToString(org.dom4j.Node outDoc)
Convert node to string
|
org.dom4j.Document |
loadDocument(String inDoc)
Load Document from specified String
|
org.dom4j.Document |
loadDocumentFromStream(InputStream inStream)
Load Document from specified Input Stream
|
public org.dom4j.Document loadDocument(String inDoc) throws org.dom4j.DocumentException
inDoc - document to be readorg.dom4j.DocumentException - if fail to read the documentpublic org.dom4j.Document loadDocumentFromStream(InputStream inStream) throws org.dom4j.DocumentException
inStream - input stream to be readorg.dom4j.DocumentException - if fail to read the documentpublic String docToString(org.dom4j.Node outDoc) throws IOException
outDoc - Node to be convertedIOException - if the conversion failpublic void docToStream(org.dom4j.Node outDoc,
OutputStream outStream)
throws IOException
outDoc - Node to be convertedoutStream - output stream of the converted nodeIOException - if the conversion failCopyright © 2009-2013. All Rights Reserved.