get Int By XML Tag Name Namespace - Android XML

Android examples for XML:Namespace

Description

get Int By XML Tag Name Namespace

Demo Code


//package com.java2s;

import org.w3c.dom.Element;

import org.w3c.dom.NodeList;

public class Main {
    public static Integer getIntByTagNameNS(Element paramElement,
            String paramString1, String paramString2) {
        Integer localInteger = null;
        if (paramElement != null) {
            NodeList localNodeList = paramElement.getElementsByTagNameNS(
                    paramString1, paramString2);
            if (localNodeList.getLength() == 1)
                localInteger = Integer.valueOf(Integer
                        .parseInt(((Element) localNodeList.item(0))
                                .getTextContent()));
        }/* w  w  w  .j av  a 2s  . c o m*/
        return localInteger;
    }
}

Related Tutorials