Android XML Element Value Get getStringValue(String tag, Element element)

Here you can find the source of getStringValue(String tag, Element element)

Description

get String Value

Declaration

public static String getStringValue(String tag, Element element) 

Method Source Code

//package com.java2s;

import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Main {
    public static String getStringValue(String tag, Element element) {
        NodeList nodes = element.getElementsByTagName(tag).item(0)
                .getChildNodes();// ww w .j  av a  2s  . com
        Node node = (Node) nodes.item(0);
        return node.getNodeValue();
    }
}

Related

  1. getTextTrim(Element elto)
  2. getTextTrim(Element elto)
  3. getValue(Element element)
  4. getValue(Element element, String elementName)
  5. getValue(Element item, String str)
  6. getCData(Element element)
  7. getContent(Element xmlElement)
  8. getElementText(Element element)
  9. getIntegerValue(String tag, Element element)