Android XML Node Value Get getElementValue(Node elem)

Here you can find the source of getElementValue(Node elem)

Description

get Element Value

Declaration

public final static String getElementValue(Node elem) 

Method Source Code

//package com.java2s;

import org.w3c.dom.Node;

public class Main {
    public final static String getElementValue(Node elem) {
        Node kid;/*www  .j a  va  2s.c o m*/
        if (elem != null) {
            if (elem.hasChildNodes()) {
                for (kid = elem.getFirstChild(); kid != null; kid = kid
                        .getNextSibling()) {
                    if (kid.getNodeType() == Node.TEXT_NODE) {
                        return kid.getNodeValue();
                    }
                }
            }
        }
        return "";
    }
}

Related

  1. GetBooleanValue(Node item)
  2. GetInt32Value(Node item)
  3. GetStringValue(Node item)
  4. getDoubleNodeValue(Node node)
  5. getElementValue(Node aElem)
  6. getElementValue(Node elem)
  7. getNextElement(Node el)
  8. getNodeValue(Node node)
  9. getText(Node n)