/** * @see Parser#startElement(java.lang.String, java.lang.String, java.lang.String, * org.xml.sax.Attributes) */ public final void startElement( String uri, String localName, String qName, Attributes attributes) { super.startElement(uri, localName, qName, attributes); if (qName.equals("guide")) { for (int i = 0; i < attributes.getLength(); i++) { // Get names and values for each attribute String name = attributes.getQName(i); String value = attributes.getValue(i); if (name.equals("country")) { guide.setCountry(value); } else if (name.equals("latitude")) { guide.setLatitude(value); } else if (name.equals("longitude")) { guide.setLongitude(value); } else if (name.equals("urlPrefix")) { guide.setUrlPrefix(value); } } } else if (qName.equals("attraction")) { attraction = new Attraction(); attraction.setGuide(guide); // Process each attribute for (int i = 0; i < attributes.getLength(); i++) { // Get names and values for each attribute String name = attributes.getQName(i); String value = attributes.getValue(i); if (name.equals("id")) { attraction.setId(value); } else if (name.equals("name")) { attraction.setName(value); } else if (name.equals("thumbnailUrl")) { attraction.setThumbnailUrl(value); } else if (name.equals("type")) { attraction.setType(value); } } } }