Java Utililty Methods XML NodeList

List of utility methods to do XML NodeList

Description

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

Method

StringgetMetaScriptType(List metaNodeList)
get Meta Script Type
Node meta = null;
NamedNodeMap attributes = null;
boolean httpEquiv = false;
String contentScriptType = null;
for (int i = metaNodeList.size() - 1; i >= 0; i--) {
    meta = (Node) metaNodeList.get(i);
    attributes = meta.getAttributes();
    httpEquiv = false;
...
LinkedHashSetgetMethodNames(NodeList methodNodes)
get Method Names
LinkedHashSet<String> methodsNames = new LinkedHashSet<String>();
for (int i = 0; i < methodNodes.getLength(); i++) {
    Node methodNode = methodNodes.item(i);
    String methodName = getMethodName(methodNode);
    if (methodName != null) {
        methodsNames.add(methodName);
return methodsNames;
NodegetNode(NodeList nodes, String tagName)
get Node
for (int x = 0; x < nodes.getLength(); x++) {
    Node node = nodes.item(x);
    if (node.getNodeName().equalsIgnoreCase(tagName)) {
        return node;
return null;
NodegetNode(String tagName, NodeList nodes)
get Node
for (int x = 0; x < nodes.getLength(); x++) {
    Node node = nodes.item(x);
    if (node.getNodeName().equalsIgnoreCase(tagName)) {
        return node;
return null;
NodegetNodeByNodeName(NodeList nodes, String nodeName)
get Node By Node Name
for (Node node : asList(nodes)) {
    if (nodeName.equals(node.getNodeName())) {
        return node;
return null;
NodegetNodeFromNodeList(NodeList list, String name)
get Node From Node List
for (int i = 0; i < list.getLength(); i++) {
    Node node = list.item(i);
    if (node.getNodeName().equals(name)) {
        return node;
return null;
NodegetNodeFromNodeList(NodeList nl, String nodeName, int index)
Gets a named node from a node list.
for (int i = 0; i < nl.getLength(); ++i) {
    Node n = nl.item(i);
    if (n.getNodeName().equals(nodeName)) {
        if (index-- == 0)
            return n;
return null;
...
NodegetNodeFromNodeList(NodeList nodeList)
Get element Node from NodeList.
if (nodeList != null && nodeList.getLength() > 0) {
    for (int i = 0; i < nodeList.getLength(); i++) {
        if (nodeList.item(i).getNodeType() == Node.ELEMENT_NODE) {
            return nodeList.item(i);
return null;
...
intgetNodeIntValue(String tagName, NodeList nodes)
get Node Int Value
for (int x = 0; x < nodes.getLength(); x++) {
    Node node = nodes.item(x);
    if (node.getNodeName().equalsIgnoreCase(tagName)) {
        NodeList childNodes = node.getChildNodes();
        for (int y = 0; y < childNodes.getLength(); y++) {
            Node data = childNodes.item(y);
            if (data.getNodeType() == Node.TEXT_NODE) {
                try {
...
NodeListgetNodeList(Element from, String elementName)
get Node List
NodeList nodes = from.getElementsByTagName(elementName);
return nodes;