disciple.util
Class XMLUtil

java.lang.Object
  |
  +--disciple.util.XMLUtil

public class XMLUtil
extends java.lang.Object


Constructor Summary
XMLUtil()
           
 
Method Summary
static org.w3c.dom.Element getChildElement(org.w3c.dom.Node parent, java.lang.String name)
          Gets a child element by node name.
static org.w3c.dom.Node getChildNode(org.w3c.dom.Node parent, java.lang.String name)
          Gets a child node by name.
static java.lang.String getElementIndexByTagName(org.w3c.dom.Element element)
          Computes the XPath index number of an Element.
static int getNodeIndex(org.w3c.dom.Node node)
          Computes the node type index number for a node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLUtil

public XMLUtil()
Method Detail

getChildElement

public static org.w3c.dom.Element getChildElement(org.w3c.dom.Node parent,
                                                  java.lang.String name)
Gets a child element by node name.

Returns:
the child element if present, else null

getChildNode

public static org.w3c.dom.Node getChildNode(org.w3c.dom.Node parent,
                                            java.lang.String name)
Gets a child node by name.

Returns:
the child node if present, else null

getNodeIndex

public static int getNodeIndex(org.w3c.dom.Node node)
Computes the node type index number for a node.

Returns:
the index number, or -1 if no parent exsists

getElementIndexByTagName

public static java.lang.String getElementIndexByTagName(org.w3c.dom.Element element)
Computes the XPath index number of an Element.

Returns:
if a parent exsists: the index number (in brackets) or an empty String, if only one element exsists with the same name.
If no parent exsits: null.


Copyright (c) 2003 Rutgers, The State University of New Jersey