net.sf.xframe.xsddoc.util
Class DomUtil

java.lang.Object
  extended bynet.sf.xframe.xsddoc.util.DomUtil

public final class DomUtil
extends java.lang.Object

DOM Utility methods.

Author:
Kurt Riede

Method Summary
static java.lang.String getAttributeValue(org.w3c.dom.Node node, java.lang.String name)
          Returns the value of a named attribute of a given node.
static org.w3c.dom.Node getFirstElementChild(org.w3c.dom.Node node)
          Returns the first child node that is an element (type == ELEMENT_NODE).
static org.w3c.dom.Node removeDuplicates(org.w3c.dom.Node parent)
          Removes all duplicate children from a given node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFirstElementChild

public static org.w3c.dom.Node getFirstElementChild(org.w3c.dom.Node node)
Returns the first child node that is an element (type == ELEMENT_NODE).

Parameters:
node - the parent node
Returns:
the first child element or null if non available

getAttributeValue

public static java.lang.String getAttributeValue(org.w3c.dom.Node node,
                                                 java.lang.String name)
Returns the value of a named attribute of a given node.

Parameters:
node - an element node
name - the name of an attribute
Returns:
the attributes value or null if the attribute doesn't exist.

removeDuplicates

public static org.w3c.dom.Node removeDuplicates(org.w3c.dom.Node parent)
Removes all duplicate children from a given node.

Parameters:
parent - the parent node of the children to process.
Returns:
the given node


Copyright © 2004-2005 xframe. All Rights Reserved.