Java XML Node Text Value existNode(Node node, String nodeName, String textValue)

Here you can find the source of existNode(Node node, String nodeName, String textValue)

Description

exist Node

License

Apache License

Declaration

static private boolean existNode(Node node, String nodeName, String textValue) 

Method Source Code

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

import org.w3c.dom.*;

public class Main {
    static private boolean existNode(Node node, String nodeName, String textValue) {
        NodeList childs = node.getChildNodes();
        for (int i = 0; i < childs.getLength(); i++) {
            if (childs.item(i).getNodeName().equals(nodeName)
                    && childs.item(i).getTextContent().equals(textValue)) {
                return true;
            }//from   w ww.  j  a  v a 2 s. c o  m
        }
        return false;
    }
}

Related

  1. addElementText(Node test, List holder)
  2. createNewTextElement(Node elem, String tag, String value)
  3. extractNodeText(Node node)
  4. extractText(Node node)
  5. findNodeText(Node node)
  6. get_inner_text(Node node)