@Override
    public void parse(InputStream stream, ContentHandler handler, Metadata metadata,
                      ParseContext context) throws IOException, SAXException, TikaException {

        metadata.set(Metadata.CONTENT_TYPE, TMX_CONTENT_TYPE.toString());

        final XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
        XMLReaderUtils.parseSAX(CloseShieldInputStream.wrap(stream), new TMXContentHandler(xhtml, metadata), context);

    }
@Test
    public void testTMX() throws Exception {
        try (InputStream input = getResourceAsStream("/test-documents/testTMX.tmx")) {
            Metadata metadata = new Metadata();
            ContentHandler handler = new BodyContentHandler();
            new TMXParser().parse(input, handler, metadata, new ParseContext());
            String content = handler.toString();
            assertContains("Hello world!", content);
            assertContains("Salut lume!", content);

            assertEquals("1", metadata.get("tu-count"));
            assertEquals("2", metadata.get("tuv-count"));
            assertEquals("en-us", metadata.get("source-language"));
            assertEquals("ro-ro", metadata.get("target-language"));
            assertEquals("apache-tika", metadata.get("creation-tool"));
        }
    }