class TMXConverter implements PropertyConverter {

	@Override
	public PropertyFile load(InputStream in, String encoding) throws IOException {
		try {
			SAXParserFactory factory = SAXParserFactory.newInstance();
			SAXParser parser = factory.newSAXParser();
			PropertyFile file = PropertiesFactory.eINSTANCE.createPropertyFile();
			TMXHandler handler = new TMXHandler(file);
			parser.getXMLReader().setEntityResolver(handler);
			parser.getXMLReader().setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
			parser.parse(in, handler);
			return file;
		} catch (ParserConfigurationException e) {
			throw new IOException(e);
		} catch (SAXException e) {
			throw new IOException(e);
		}
	}

}