org.deegree.framework.xml
Class DOMPrinter
java.lang.Object
org.deegree.framework.xml.DOMPrinter
public class DOMPrinter
- extends java.lang.Object
DOMPrinter
contains various methods to print DOM-XML-elements to a String,PrintWriter or Standard out.
- Version:
- $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
- Author:
- Andreas Poth, last edited by: $Author: mschneider $
Method Summary |
static java.lang.String |
nodeToString(org.w3c.dom.Node node,
java.lang.String encoding)
|
static void |
printNode(org.w3c.dom.Node node,
java.lang.String indent)
|
static void |
printNode(java.io.PrintWriter out,
org.w3c.dom.Node node)
|
static java.lang.StringBuffer |
validateCDATA(java.lang.String cdata)
Checks if a given CDATA-value has to be escaped if it is used as a text value in an XML element. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DOMPrinter
public DOMPrinter()
printNode
public static void printNode(java.io.PrintWriter out,
org.w3c.dom.Node node)
- Parameters:
out
- node
-
printNode
public static void printNode(org.w3c.dom.Node node,
java.lang.String indent)
- Parameters:
node
- indent
-
nodeToString
public static java.lang.String nodeToString(org.w3c.dom.Node node,
java.lang.String encoding)
- Parameters:
node
- encoding
-
- Returns:
- the String representation of the given node.
validateCDATA
public static java.lang.StringBuffer validateCDATA(java.lang.String cdata)
- Checks if a given CDATA-value has to be escaped if it is used as a text value in an XML element. If the submitted
string contains a character that have to be escaped or if the string is made of more than 1500 characters it is
encapsulated into a CDATA-section. Returns a version that is safe to be used.
The method is just proofed for the UTF-8 character encoding.
- Parameters:
cdata
- value to be used
- Returns:
- the very same value (but escaped if necessary)
- To do:
- refactoring required
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org