Java XML Node Text Value getNodeText(Node node)

Here you can find the source of getNodeText(Node node)

Description

get Node Text

License

Open Source License

Declaration

public static String getNodeText(Node node) 

Method Source Code

//package com.java2s;
/* Copyright (c) 2016 by crossmobile.org
 *
 * CrossMobile is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 2.
 *
 * CrossMobile is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with CrossMobile; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *///from   ww w . jav  a2 s .  c  om

import org.w3c.dom.DOMException;

import org.w3c.dom.Node;

public class Main {
    public static String getNodeText(Node node) {
        try {
            return node.getTextContent();
        } catch (DOMException ex) {
            return null;
        }
    }
}

Related

  1. getNamespaceURIFromPrefix(Node context, String prefix)
  2. getNamespaceURIFromPrefix(Node context, String prefix)
  3. getNodeText(final Node node)
  4. getNodeText(Node node)
  5. getNodeText(Node node)
  6. getNodeText(Node node)
  7. getNodeText(Node node)
  8. getNodeText(Node node)
  9. getNodeText(Node t)