Code example for XmlResourceParser

Methods: getAttributeIntValue, getAttributeValue

0
		return ts;
	} 
 
	private static TMXObjectGroup readTMXObjectGroup(XmlResourceParser xrp) throws XmlPullParserException, IOException {
		final TMXObjectGroup group = new TMXObjectGroup();
		group.name = xrp.getAttributeValue(null, "name");
		group.width = xrp.getAttributeIntValue(null, "width", 1);
		group.height = xrp.getAttributeIntValue(null, "height", 1);
		XmlResourceParserUtils.readCurrentTagUntilEnd(xrp, new XmlResourceParserUtils.TagHandler() {
			public void handleTag(XmlResourceParser xrp, String tagName) throws XmlPullParserException, IOException {
				if (tagName.equals("object")) {
					group.objects.add(readTMXObject(xrp));
				} 
			} 
		}); 
		return group;
	} 
 
	private static TMXObject readTMXObject(XmlResourceParser xrp) throws XmlPullParserException, IOException {
		final TMXObject object = new TMXObject();
		object.name = xrp.getAttributeValue(null, "name");