get XML Node Value - Android XML

Android examples for XML:XML Node

Description

get XML Node Value

Demo Code


//package com.java2s;

import org.w3c.dom.Node;

public class Main {
    public static String getNodeValue(Node node) {
        String value = "";

        try {//from   w  ww . j av a 2 s .  co  m
            if (node.getFirstChild() != null)
                value = node.getFirstChild().getNodeValue();
        } catch (Exception e) {
            value = null;
        }

        return value;
    }
}

Related Tutorials