1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 12:02:05 +01:00

Add ParserUtils.getXmlLang(XmlPullParser)

and add TODO comment to PacketParserUtils.getLanguageAttribute().
This commit is contained in:
Florian Schmaus 2017-06-17 11:42:09 +02:00
parent 5424c9635f
commit 1448fa4632
2 changed files with 7 additions and 0 deletions

View file

@ -976,6 +976,8 @@ public class PacketParserUtils {
return new Session.Feature(optional);
}
// TODO Remove this static method and use ParserUtils.getXmlLang(XmlPullParser) instead.
private static String getLanguageAttribute(XmlPullParser parser) {
// CHECKSTYLE:OFF
for (int i = 0; i < parser.getAttributeCount(); i++) {

View file

@ -251,4 +251,9 @@ public class ParserUtils {
}
return text;
}
public static String getXmlLang(XmlPullParser parser) {
String langString = parser.getAttributeValue("http://www.w3.org/XML/1998/namespace", "lang");
return langString;
}
}