Java XML Node Text Value getFirstExtensionNode(Node extensionsNode)

Here you can find the source of getFirstExtensionNode(Node extensionsNode)

Description

Returns first extension node

License

Apache License

Parameter

Parameter Description
extensionsNode extension node

Declaration

private static Node getFirstExtensionNode(Node extensionsNode) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Main {
    /**/*ww  w .  jav  a2 s.  c  o  m*/
     * Returns first extension node
     * 
     * @param extensionsNode
     *            extension node
     */
    private static Node getFirstExtensionNode(Node extensionsNode) {
        final String extensionTag = "extension";
        NodeList nodes = extensionsNode.getChildNodes();
        for (int i = 0; i < nodes.getLength(); i++) {
            Node child = nodes.item(i);
            if (extensionTag.equals(child.getNodeName()))
                return child;
        }
        return null;
    }
}

Related

  1. getContentsOfTextOnlyNode(Node n)
  2. getContentText(Node n)
  3. getDescendentText(Node node, String name)
  4. getDirectText(org.w3c.dom.Element node)
  5. getElementText(Node elem)
  6. getFirstExtensionNodeFromWorkingSet(Node extensionsNode, String workingSetName)
  7. getFirstLevelTextContent(Node node)
  8. getFirstSubElementsInnerText(Node element, String subElementName)
  9. getInnerXmlText(Node xmlNode)