Java XML Element Text getElementText(Element namedElement)

Here you can find the source of getElementText(Element namedElement)

Description

get Element Text

License

Open Source License

Declaration

public static String getElementText(Element namedElement) 

Method Source Code


//package com.java2s;
// Released under the terms of the CPL Common Public License version 1.0.

import org.w3c.dom.*;

public class Main {
    public static String getElementText(Element namedElement) {
        if (namedElement == null) {
            return null;
        }/*from  www. java  2s .c om*/
        String text = namedElement.getTextContent();
        return (text.isEmpty()) ? null : text;
    }
}

Related

  1. getElementText(Element element, String tagName, String namespace)
  2. getElementText(Element elm)
  3. getElementText(Element elm)
  4. getElementText(Element elm)
  5. getElementText(Element n)
  6. getElementText(Element root, String tagname)
  7. getElementText(final Element element)
  8. getElementTextByTagName(Element n, String elementName)
  9. getElementTextDataNoEx(Element element, boolean unindent)