nl.knowledgeplaza.util
Class Dom4jUtil

java.lang.Object
  extended by nl.knowledgeplaza.util.Dom4jUtil

public class Dom4jUtil
extends Object


Constructor Summary
Dom4jUtil()
           
 
Method Summary
static org.dom4j.Document parse(String xml)
          Utility method to parse an XML document in a string
static org.dom4j.Document read(File file)
          Just a simple method to read a file
static org.dom4j.Document read(InputStream inputStream)
          Just a simple method to read an inputstream
static org.dom4j.Document toDom4j(Document w3cDocument)
          Convert a W3C document to a Dom4j Document
static String toString(org.dom4j.Document document)
          Convert Dom4j document to string completely formatted
static String toString(org.dom4j.Element element)
          Convert Dom4j document to string completely formatted
static void write(org.dom4j.Document document, OutputStream outputStream, String encoding)
          Write a document completely formatted to an outputstream.
static void write(org.dom4j.Element element, OutputStream outputStream, String encoding)
          Write a document completely formatted to an outputstream.
static void writeAsHTML(org.dom4j.Document document, OutputStream outputStream, String encoding)
          Write a document completely formatted to an outputstream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dom4jUtil

public Dom4jUtil()
Method Detail

read

public static org.dom4j.Document read(File file)
                               throws org.dom4j.DocumentException
Just a simple method to read a file

Throws:
org.dom4j.DocumentException

read

public static org.dom4j.Document read(InputStream inputStream)
                               throws org.dom4j.DocumentException
Just a simple method to read an inputstream

Throws:
org.dom4j.DocumentException

parse

public static org.dom4j.Document parse(String xml)
Utility method to parse an XML document in a string

Parameters:
xml -
Returns:

write

public static void write(org.dom4j.Document document,
                         OutputStream outputStream,
                         String encoding)
                  throws UnsupportedEncodingException,
                         IOException
Write a document completely formatted to an outputstream.

Parameters:
document -
outputStream -
encoding -
Throws:
UnsupportedEncodingException
IOException

write

public static void write(org.dom4j.Element element,
                         OutputStream outputStream,
                         String encoding)
                  throws UnsupportedEncodingException,
                         IOException
Write a document completely formatted to an outputstream.

Parameters:
element -
outputStream -
encoding -
Throws:
UnsupportedEncodingException
IOException

writeAsHTML

public static void writeAsHTML(org.dom4j.Document document,
                               OutputStream outputStream,
                               String encoding)
                        throws UnsupportedEncodingException,
                               IOException
Write a document completely formatted to an outputstream.

Parameters:
document -
outputStream -
encoding -
Throws:
UnsupportedEncodingException
IOException

toString

public static String toString(org.dom4j.Document document)
Convert Dom4j document to string completely formatted

Parameters:
document -
Returns:

toString

public static String toString(org.dom4j.Element element)
Convert Dom4j document to string completely formatted

Parameters:
element -
Returns:

toDom4j

public static org.dom4j.Document toDom4j(Document w3cDocument)
Convert a W3C document to a Dom4j Document

Parameters:
w3cDocument -
Returns:


Copyright © 2012 KnowledgePlaza. All Rights Reserved.