edu.harvard.seas.iis.util.xml
Class XmlUtils

java.lang.Object
  extended by edu.harvard.seas.iis.util.xml.XmlUtils

public class XmlUtils
extends java.lang.Object

Author:
kgajos

Constructor Summary
XmlUtils()
           
 
Method Summary
static org.w3c.dom.Node findFirstNodeByName(java.lang.String name, org.w3c.dom.Node start)
          Performs depth-first search of a document tree and returns the first node it finds with a given name
static boolean getNodeAttributeBooleanValue(org.w3c.dom.Node node, java.lang.String attributeName, boolean defaultValue)
           
static double getNodeAttributeDoubleValue(org.w3c.dom.Node node, java.lang.String attributeName, double defaultValue)
           
static int getNodeAttributeIntValue(org.w3c.dom.Node node, java.lang.String attributeName, int defaultValue)
           
static long getNodeAttributeLongValue(org.w3c.dom.Node node, java.lang.String attributeName, long defaultValue)
           
static java.lang.String getNodeAttributeValue(org.w3c.dom.Node node, java.lang.String attributeName, java.lang.String defaultValue)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlUtils

public XmlUtils()
Method Detail

findFirstNodeByName

public static org.w3c.dom.Node findFirstNodeByName(java.lang.String name,
                                                   org.w3c.dom.Node start)
Performs depth-first search of a document tree and returns the first node it finds with a given name

Parameters:
name - name of the node we are looking for
start - start node
Returns:
a node with a given name or null if none was found

getNodeAttributeValue

public static java.lang.String getNodeAttributeValue(org.w3c.dom.Node node,
                                                     java.lang.String attributeName,
                                                     java.lang.String defaultValue)

getNodeAttributeBooleanValue

public static boolean getNodeAttributeBooleanValue(org.w3c.dom.Node node,
                                                   java.lang.String attributeName,
                                                   boolean defaultValue)

getNodeAttributeIntValue

public static int getNodeAttributeIntValue(org.w3c.dom.Node node,
                                           java.lang.String attributeName,
                                           int defaultValue)

getNodeAttributeLongValue

public static long getNodeAttributeLongValue(org.w3c.dom.Node node,
                                             java.lang.String attributeName,
                                             long defaultValue)

getNodeAttributeDoubleValue

public static double getNodeAttributeDoubleValue(org.w3c.dom.Node node,
                                                 java.lang.String attributeName,
                                                 double defaultValue)