Android XML Node Value Get GetStringValue(Node item)

Here you can find the source of GetStringValue(Node item)

Description

Get String Value

Declaration

public static String GetStringValue(Node item) throws Exception 

Method Source Code

//package com.java2s;

import org.w3c.dom.*;

public class Main {
    public static String GetStringValue(Node item) throws Exception {
        if (item instanceof Element) {
            Node node = item.getFirstChild();
            if (node != null)
                return node.getNodeValue();
            else//from   www.  j a v a2  s  . c o  m
                return "";
        } else
            throw new Exception(String.format("Cannot handle '%s'.",
                    item.getClass()));
    }
}

Related

  1. GetBooleanValue(Node item)
  2. GetInt32Value(Node item)
  3. getDoubleNodeValue(Node node)
  4. getElementValue(Node aElem)
  5. getElementValue(Node elem)
  6. getElementValue(Node elem)