ca.intelliware.amakihi.util.xml
Class DOMUtils

java.lang.Object
  |
  +--ca.intelliware.amakihi.util.xml.DOMUtils

public class DOMUtils
extends java.lang.Object

Provides simple utilities for Document Object Model (DOM) manipulation.

Version:
$Revision: 1.3 $
Author:
Intelliware Development

Constructor Summary
DOMUtils()
           
 
Method Summary
static boolean elementHasSubElements(org.w3c.dom.Element element)
           
static org.w3c.dom.Element getFirstElementByLocalName(org.w3c.dom.Element parent, java.lang.String tagName)
          Find the first child element by local name.
static org.w3c.dom.Element getFirstElementByTagNameNS(org.w3c.dom.Element parent, java.lang.String namespace, java.lang.String tagName)
          Find the first child element by namespace and tag name.
static java.lang.String getTextValue(org.w3c.dom.Node node)
          Scan all immediate children of a node, and append all text nodes into a string.
 
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

getFirstElementByTagNameNS

public static org.w3c.dom.Element getFirstElementByTagNameNS(org.w3c.dom.Element parent,
                                                             java.lang.String namespace,
                                                             java.lang.String tagName)

Find the first child element by namespace and tag name.

Parameters:
parent - - the node whose children are being scanned for a match
namespace - - the namespace of the element
tagName - - the local name of the element

getFirstElementByLocalName

public static org.w3c.dom.Element getFirstElementByLocalName(org.w3c.dom.Element parent,
                                                             java.lang.String tagName)

Find the first child element by local name.

Parameters:
parent - - the node whose children are being scanned for a match
tagName - - the local name of the element

getTextValue

public static java.lang.String getTextValue(org.w3c.dom.Node node)

Scan all immediate children of a node, and append all text nodes into a string. Consider the following example:

  <customer>Joe Schmoe</customer>
  

In this case, calling this method on the customer element returns "Joe Schmoe".


elementHasSubElements

public static boolean elementHasSubElements(org.w3c.dom.Element element)


Copyright 2002 Intelliware Development. All Rights Reserved.