org.translet.helper
Class DomUtils

java.lang.Object
  |
  +--org.translet.helper.DomUtils

public class DomUtils
extends Object


Constructor Summary
DomUtils()
           
 
Method Summary
static Node getFirstChildWithIndex(Node root, String tagName, int position)
          Returns a node with tagname and at the specified position.
static Node getFirstChildWithTag(Node root, String tagName)
           
static Document parse(InputStream is, String encoding, Properties p)
           
static String serialize(Node n)
           
static String serialize(Node n, org.apache.xml.serialize.OutputFormat format)
           
static void serialize(Node n, OutputStream outStream)
           
static void serialize(Node n, OutputStream outStream, org.apache.xml.serialize.OutputFormat format)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomUtils

public DomUtils()
Method Detail

serialize

public static String serialize(Node n)
                        throws IOException

serialize

public static String serialize(Node n,
                               org.apache.xml.serialize.OutputFormat format)
                        throws IOException

serialize

public static void serialize(Node n,
                             OutputStream outStream)
                      throws IOException

serialize

public static void serialize(Node n,
                             OutputStream outStream,
                             org.apache.xml.serialize.OutputFormat format)
                      throws IOException

getFirstChildWithIndex

public static Node getFirstChildWithIndex(Node root,
                                          String tagName,
                                          int position)
Returns a node with tagname and at the specified position. The position is an index from a 1 based array.

getFirstChildWithTag

public static Node getFirstChildWithTag(Node root,
                                        String tagName)

parse

public static Document parse(InputStream is,
                             String encoding,
                             Properties p)
                      throws SAXException,
                             IOException,
                             ParserConfigurationException