org.jboss.util.xml
Class DOMWriter

java.lang.Object
  extended byorg.jboss.util.xml.DOMWriter

public class DOMWriter
extends java.lang.Object

A sample DOM writer. This sample program illustrates how to traverse a DOM tree in order to print a document that is parsed.


Field Summary
protected  boolean canonical
          Canonical output.
protected  java.io.PrintWriter out
          Print writer.
 
Constructor Summary
DOMWriter(java.io.Writer w)
           
DOMWriter(java.io.Writer w, boolean canonical)
           
 
Method Summary
protected  java.lang.String normalize(java.lang.String s)
          Normalizes the given string.
 void print(org.w3c.dom.Node node)
           
 void print(org.w3c.dom.Node node, boolean prettyprint)
           
protected  org.w3c.dom.Attr[] sortAttributes(org.w3c.dom.NamedNodeMap attrs)
          Returns a sorted list of attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected java.io.PrintWriter out
Print writer.


canonical

protected boolean canonical
Canonical output.

Constructor Detail

DOMWriter

public DOMWriter(java.io.Writer w)

DOMWriter

public DOMWriter(java.io.Writer w,
                 boolean canonical)
Method Detail

print

public void print(org.w3c.dom.Node node)

print

public void print(org.w3c.dom.Node node,
                  boolean prettyprint)

sortAttributes

protected org.w3c.dom.Attr[] sortAttributes(org.w3c.dom.NamedNodeMap attrs)
Returns a sorted list of attributes.


normalize

protected java.lang.String normalize(java.lang.String s)
Normalizes the given string.