@Override
				public void endElement(String uri, String localName, String elementName) throws SAXException {
					switch (elementName) {
						case (XML_NODE_TILESET_KEY): {
							if (tilesetPath != null && firstGid > 0 && tilesetWidth > 0 && tilesetHeight > 0) {
								// completed parsing of an entire tileset
								result.addTileset(tilesetPath, tilesetWidth, tilesetHeight, firstGid);

								tilesetPath = null;
								firstGid = tilesetWidth = tilesetHeight = 0;
							}
							break;
						}
						case (XML_NODE_DATA_KEY): {
							// completed parsing of an entire tilesetindex section
							result.addTileIndex(tileIndex);
							tileIndex.clear();
							break;
						}
					}
				}