Here you can find the source of IsName(XmlPullParser reader, String namespaceName, String localName)
public static boolean IsName(XmlPullParser reader, String namespaceName, String localName)
//package com.java2s; //License from project: Open Source License import org.xmlpull.v1.XmlPullParser; public class Main { public static boolean IsName(XmlPullParser reader, String namespaceName, String localName) { if (reader == null) throw new NullPointerException(); String ns = reader.getNamespace(); if (isNullOrEmpty(ns)) { ns = null;/*from w w w .j a v a 2 s . c o m*/ } if (isNullOrEmpty(namespaceName)) { namespaceName = null; } return (StringEquals(ns, namespaceName)) && (isNullOrEmpty(localName) || StringEquals( reader.getName(), localName)); } private static boolean isNullOrEmpty(String s) { return s == null || s.length() == 0; } private static boolean StringEquals(String s1, String s2) { if (s1 == s2) return true; if (s1 == null || s2 == null) return false; return s1.equals(s2); } }