jcreek.cke.importexport.xml
Class DOMutilities

java.lang.Object
  extended byjcreek.cke.importexport.xml.DOMutilities

public class DOMutilities
extends java.lang.Object

The intention of this class is to gather utilities that may be useful when working with DOM documents.

Author:
Stein L. Tomassen, NTNU 2002

Constructor Summary
DOMutilities()
           
 
Method Summary
static java.lang.String getAttributeValueByName(java.lang.String attribName, org.w3c.dom.NamedNodeMap attribList)
          Gets the value of an attribute from an attribute list by giving the name of the attribute.
static org.w3c.dom.Node getNodeByName(java.lang.String nodeName, short nodeType, org.w3c.dom.NodeList nodeList)
          Gets the node in from an node list by giving the name of the node.
static java.lang.String getValueWithoutNS(java.lang.String valueStr)
          Get's a value without it's namespace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMutilities

public DOMutilities()
Method Detail

getValueWithoutNS

public static java.lang.String getValueWithoutNS(java.lang.String valueStr)
Get's a value without it's namespace. The assumed delimiter is the "#" character.

Parameters:
valueStr - the string containing the value
Returns:
the value without the namespace. If the value didn't have any namespace, then the original value is returned.

getAttributeValueByName

public static java.lang.String getAttributeValueByName(java.lang.String attribName,
                                                       org.w3c.dom.NamedNodeMap attribList)
Gets the value of an attribute from an attribute list by giving the name of the attribute. Does not use namespaces,

Parameters:
attribName - the name of the attribute looking for
attribList - the list of attributes
Returns:
the value of the attribute if found else it will return null

getNodeByName

public static org.w3c.dom.Node getNodeByName(java.lang.String nodeName,
                                             short nodeType,
                                             org.w3c.dom.NodeList nodeList)
Gets the node in from an node list by giving the name of the node. Does not use namespaces,

Parameters:
nodeName - the name of the node looking for
nodeType - the type of node looking for. The node types are declared in the Node class.
nodeList - the list of nodes
Returns:
the node if found else it will return null


Created at IDI, NTNU by the Artificial Intelligence and Learning group