Java XML Node Text Value getContentText(Node n)

Here you can find the source of getContentText(Node n)

Description

get Content Text

License

LGPL

Declaration

public static String getContentText(Node n) 

Method Source Code

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

import org.w3c.dom.*;

public class Main {
    public static String getContentText(Node n) {
        if (n == null)
            return null;
        if (n.getFirstChild() == null) {
            return "";
        }/*from   ww w  .j  a v a  2 s.c o  m*/

        return n.getFirstChild().getNodeValue();
    }
}

Related

  1. extractText(Node node)
  2. findNodeText(Node node)
  3. get_inner_text(Node node)
  4. getAppInfoText(final Node node)
  5. getContentsOfTextOnlyNode(Node n)
  6. getDescendentText(Node node, String name)
  7. getDirectText(org.w3c.dom.Element node)
  8. getElementText(Node elem)
  9. getFirstExtensionNode(Node extensionsNode)