0

The XML file is:

<name></name>

If I parse the XML with:

String result = null;
if (parser.next() == XmlPullParser.TEXT) {
     result = parser.getText();
     parser.nextTag();
}
return result;

Does it return null or does it return an empty string "" ?

nomnom
  • 1,560
  • 5
  • 17
  • 31

1 Answers1

0

From the Android Developers XmlPullParser Reference

If element content is empty (content is "") then no TEXT event will be reported.

So it should return null.

Keno
  • 2,018
  • 1
  • 16
  • 26