Code example for SAXParseException

0
		parser.parse(new ByteArrayInputStream(text.getBytes(Charset.availableCharsets().get("UTF-8"))), this);
		 
		if(msg != null) {
			return msg;
		} else { 
			throw new SAXParseException("Invalid XML format...", null);
		} 
	} 
	 
	private AbstractMessage msg;
	private String currentString;
	private String element;
	 
	private ArrayList<UserLocation> list;
	private UserLocation userLocation;
	private String username;
	private boolean isAccepted;
	private int latitude, longtitude;
	private int gender, bgColor;
	private GeoPoint geoPoint;