Java XML Node Text Value getNodeTextContent(Node node, String node_name)

Here you can find the source of getNodeTextContent(Node node, String node_name)

Description

get Node Text Content

License

LGPL

Declaration

public static String getNodeTextContent(Node node, String node_name) 

Method Source Code


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

import org.w3c.dom.*;

public class Main {
    public static String getNodeTextContent(Node node, String node_name) {
        return getNodeTextContent(node, node_name, "");
    }//w w w .j  ava2 s .c  o m

    public static String getNodeTextContent(Node node, String node_name, String def) {
        if (node == null || node_name == null)
            return def;
        String text = node.getTextContent();
        return text != null ? text : def;
    }
}

Related

  1. getNodeText(Node node)
  2. getNodeText(Node node)
  3. getNodeText(Node node)
  4. getNodeText(Node t)
  5. getNodeText(org.w3c.dom.Node node)
  6. getNodeTexts(Node node, String... nodePath)
  7. getNodeTextValue(final Node node)
  8. getNodeTextValue(final Node node)
  9. getNodeTextValue(Node node)