deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.framework.xml
Class DOMPrinter

java.lang.Object
  extended by org.deegree.framework.xml.DOMPrinter

public class DOMPrinter
extends 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 $

Constructor Summary
DOMPrinter()
           
 
Method Summary
static String nodeToString(Node node, String encoding)
           
static void printNode(Node node, String indent)
           
static void printNode(PrintWriter out, Node node)
           
static StringBuffer validateCDATA(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
 

Constructor Detail

DOMPrinter

public DOMPrinter()
Method Detail

printNode

public static void printNode(PrintWriter out,
                             Node node)
Parameters:
out -
node -

printNode

public static void printNode(Node node,
                             String indent)
Parameters:
node -
indent -

nodeToString

public static String nodeToString(Node node,
                                  String encoding)
Parameters:
node -
encoding -
Returns:
the String representation of the given node.

validateCDATA

public static StringBuffer validateCDATA(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

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org