XmlPullParser parser = new XmlPullParser();
parser.parse(is);
while (true)
{
XmlTag elem;
do
{
elem = (XmlTag)parser.nextTag();
}
while (elem != null && (!(elem.getName().equals(mapping) && elem.isOpen())));
if (elem == null)
{
break;
}
String encounteredFilterName = null, urlPattern = null;
do
{
elem = (XmlTag)parser.nextTag();
if (elem.isOpen())
{
parser.setPositionMarker();
}
else if (elem.isClose() && elem.getName().equals(name))
{
encounteredFilterName = parser.getInputFromPositionMarker(elem.getPos())
.toString()
.trim();
}
else if (elem.isClose() && elem.getName().equals("url-pattern"))
{
urlPattern = parser.getInputFromPositionMarker(elem.getPos())
.toString()
.trim();
}
}
while (urlPattern == null || encounteredFilterName == null);