Java Globus API: Class DomDocumentInterface

org.globus.xml
Class DomDocumentInterface

java.lang.Object
  |
  +--org.globus.xml.DomDocumentInterface

public class DomDocumentInterface
extends java.lang.Object

This class provides a higher-level interface to an XML DOM tree

Author:
Peter Lane

Constructor Summary
DomDocumentInterface(java.lang.String xmlString)
          Creates a DOM document interface using the specified XML document string
 
Method Summary
 org.w3c.dom.Document getDocument()
          Gets the DOM document node
static java.lang.String getElementAttribute(org.w3c.dom.Element element, java.lang.String attributeName)
          Gets the value of the attribute with the specified name within the specified element subtree
 org.w3c.dom.NodeList getElements()
          Gets a list of all elements within the DOM document tree
 org.w3c.dom.NodeList getElements(java.lang.String elementName)
          Gets a list of all elements with the specified name within the DOM tree
static java.lang.String getElementText(org.w3c.dom.Element element)
          Gets any text associated with an element subtree in the DOM tree
static java.lang.String getXMLString(org.w3c.dom.Node node)
           
static java.lang.String getXMLString(org.w3c.dom.Node node, int indent)
           
protected  java.lang.String nodeTypeToString(short nodeType)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DomDocumentInterface

public DomDocumentInterface(java.lang.String xmlString)
                     throws org.xml.sax.SAXException
Creates a DOM document interface using the specified XML document string
Parameters:
xmlString - the XML document string
Method Detail

getDocument

public org.w3c.dom.Document getDocument()
Gets the DOM document node
Returns:
the DOM document node

getElements

public org.w3c.dom.NodeList getElements()
Gets a list of all elements within the DOM document tree
Returns:
the DOM document element nodes

getElements

public org.w3c.dom.NodeList getElements(java.lang.String elementName)
Gets a list of all elements with the specified name within the DOM tree
Parameters:
elementName - the name of the desired element nodes
Returns:
the list of desired element nodes

getElementAttribute

public static java.lang.String getElementAttribute(org.w3c.dom.Element element,
                                                   java.lang.String attributeName)
Gets the value of the attribute with the specified name within the specified element subtree
Parameters:
element - the root, element subtree node
attributeName - the name of the desired attribute
Returns:
the string value of the desired attribute

getElementText

public static java.lang.String getElementText(org.w3c.dom.Element element)
Gets any text associated with an element subtree in the DOM tree
Parameters:
element - the root, element subtree node
Returns:
the string value of the desired element text

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getXMLString

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

getXMLString

public static java.lang.String getXMLString(org.w3c.dom.Node node,
                                            int indent)

nodeTypeToString

protected java.lang.String nodeTypeToString(short nodeType)