Java Utililty Methods XML Node Name

List of utility methods to do XML Node Name

Description

The list of methods to do XML Node Name are organized into topic(s).

Method

ArrayListgetAllNodes(Node node, String[] nodeNamesArray)
get All Nodes
ArrayList nodeList = new ArrayList();
findAllNodes(node, nodeNamesArray, nodeList);
return nodeList;
NodegetBeanElement(Node elem, String nodeName)
get Bean Element
if (!nodeName.equals(elem.getLocalName()) && !elem.getOwnerDocument().equals(elem.getParentNode())) {
    return getBeanElement(elem.getParentNode(), nodeName);
} else {
    return elem;
NodegetDescendent(Node node, String nodeName)
get Descendent
NodeList children = node.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
    Node child = children.item(i);
    if (child.getNodeName().equals(nodeName)) {
        return child;
return null;
...
intgetIntegerNodeValue(Node node, String nodeName)
get Integer Node Value
return Integer.parseInt(getStringNodeValue(node, nodeName));
StringgetName(Node node)
Gets the local (sans namespace) name of the given node.
String name = node.getNodeName();
int colon = name.lastIndexOf(":");
return colon < 0 ? name : name.substring(colon + 1);
StringgetName(Node node)
get Name
return node.getNodeName();
StringgetName(Node node)
get Name
return node.getNodeName();
NodegetNode(final Node iNode, final String iNodeName)
This method returns the desired node which is determined by the provided node name and namespace.
Node result = null;
if (iNode != null) {
    NodeList children = iNode.getChildNodes();
    if (children != null) {
        for (int i = 0; i < children.getLength(); i++) {
            Node currentChild = children.item(i);
            String currentChildName = currentChild.getLocalName();
            if (currentChildName != null) {
...
NodegetNode(Node iNode, String iNodeName)
This method returns the desired node which is determined by the provided node name and namespace.
Logger.getLogger("org.adl.util.debug.samplerte").entering("DOMTreeUtility", "getNode()");
Logger.getLogger("org.adl.util.debug.samplerte").info("Parent Node: " + iNode.getLocalName());
Logger.getLogger("org.adl.util.debug.samplerte").info("Node being searched for: " + iNodeName);
Node result = null;
if (iNode != null) {
    NodeList children = iNode.getChildNodes();
    if (children != null) {
        for (int i = 0; i < children.getLength(); i++) {
...
NodegetNode(Node iNode, String iNodeName)
This method returns the desired node which is determined by the provided node name and namespace.
Node result = null;
if (iNode != null) {
    NodeList children = iNode.getChildNodes();
    if (children != null) {
        for (int i = 0; i < children.getLength(); i++) {
            Node currentChild = children.item(i);
            String currentChildName = currentChild.getLocalName();
            if (currentChildName != null) {
...