net.grelf
Class XmlUtil

java.lang.Object
  extended by net.grelf.XmlUtil

public class XmlUtil
extends java.lang.Object

Some static utility methods for working with XML. This class cannot be instantiated.


Method Summary
static java.lang.StringBuffer escape(java.lang.StringBuffer sb)
          Convert the 5 special characters <>'"& to entities wherever they occur in the given text.
static void outputDocument(java.io.PrintWriter out, org.w3c.dom.Document doc)
          Use a dummy XSLT transform to output a DOM document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

escape

public static java.lang.StringBuffer escape(java.lang.StringBuffer sb)
Convert the 5 special characters <>'"& to entities wherever they occur in the given text. #39 is used instead of apos so the result works for HTML browsers as well as XML parsers.


outputDocument

public static void outputDocument(java.io.PrintWriter out,
                                  org.w3c.dom.Document doc)
Use a dummy XSLT transform to output a DOM document.