SK.gnome.dwarf.utils
Class XMLUtils

java.lang.Object
  extended bySK.gnome.dwarf.utils.XMLUtils

public class XMLUtils
extends java.lang.Object

A utility class for manipulating with DOM trees.


Method Summary
static org.w3c.dom.Element getChild(org.w3c.dom.Element element, java.lang.String name)
          Returns a directly nested element of the given element.
static org.w3c.dom.Element getChildNS(org.w3c.dom.Element element, java.lang.String name, java.lang.String uri)
          Returns a directly nested element of the given element within the given namespace.
static java.util.Iterator getChildren(org.w3c.dom.Element element)
          Returns all directly nested child elements of the given element.
static java.util.Iterator getChildren(org.w3c.dom.Element element, java.lang.String name)
          Returns directly nested child elements of the given element with the given name.
static java.util.List getChildrenList(org.w3c.dom.Element element)
          Returns all directly nested child elements of the given element.
static java.util.List getChildrenList(org.w3c.dom.Element element, java.lang.String name)
          Returns directly nested child elements of the given element with the given name.
static java.lang.String getChildTextTrim(org.w3c.dom.Element element, java.lang.String name)
          Returns the text value of a directly nested element of the given element.
static java.lang.String getTextTrim(org.w3c.dom.Element element)
          Returns the text value of the given element.
static void removeChildren(org.w3c.dom.Element element)
          Removes all child elements from the given element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTextTrim

public static java.lang.String getTextTrim(org.w3c.dom.Element element)
Returns the text value of the given element.

Parameters:
element - the element
Returns:
the text string

getChildTextTrim

public static java.lang.String getChildTextTrim(org.w3c.dom.Element element,
                                                java.lang.String name)
Returns the text value of a directly nested element of the given element.

Parameters:
element - the element
name - the nested element name
Returns:
the text string

getChild

public static org.w3c.dom.Element getChild(org.w3c.dom.Element element,
                                           java.lang.String name)
Returns a directly nested element of the given element.

The element is searched within the namespace of the element argument.

Parameters:
element - the element
name - the nested element name
Returns:
the nested element

getChildNS

public static org.w3c.dom.Element getChildNS(org.w3c.dom.Element element,
                                             java.lang.String name,
                                             java.lang.String uri)
Returns a directly nested element of the given element within the given namespace.

Parameters:
element - the element
name - the nested element name
uri - the namespace URI
Returns:
the nested element

getChildrenList

public static java.util.List getChildrenList(org.w3c.dom.Element element)
Returns all directly nested child elements of the given element.

Parameters:
element - the element
Returns:
the child elements

getChildrenList

public static java.util.List getChildrenList(org.w3c.dom.Element element,
                                             java.lang.String name)
Returns directly nested child elements of the given element with the given name.

Parameters:
element - the element
name - the nested element name
Returns:
the child elements

getChildren

public static java.util.Iterator getChildren(org.w3c.dom.Element element)
Returns all directly nested child elements of the given element.

Parameters:
element - the element
Returns:
the child elements

getChildren

public static java.util.Iterator getChildren(org.w3c.dom.Element element,
                                             java.lang.String name)
Returns directly nested child elements of the given element with the given name.

Parameters:
element - the element
name - the nested element name
Returns:
the child elements

removeChildren

public static void removeChildren(org.w3c.dom.Element element)
Removes all child elements from the given element.

Parameters:
element - the element


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.