@Override
    public void parse(InputStream stream, ContentHandler handler, Metadata metadata,
                      ParseContext context) throws IOException, SAXException, TikaException {
        // TODO Auto-generated method stub
        final XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
        xhtml.startDocument();
        xhtml.startElement("p");
        TaggedContentHandler tagged = new TaggedContentHandler(handler);
        try {
            XMLReaderUtils.parseSAX(CloseShieldInputStream.wrap(stream),
                            new EmbeddedContentHandler(
                                    getContentHandler(tagged, metadata, context)),
                    context);
        } catch (SAXException e) {
            tagged.throwIfCauseOf(e);
            throw new TikaException("XML parse error", e);
        } finally {
            xhtml.endElement("p");
            xhtml.endDocument();
        }

    }
@Test
    public void testDifMetadata() throws Exception {
        Parser parser = new DIFParser();
        ContentHandler handler = new BodyContentHandler();
        Metadata metadata = new Metadata();

        try (InputStream stream = getResourceAsStream("/test-documents/Zamora2010.dif")) {
            parser.parse(stream, handler, metadata, new ParseContext());
        }

        assertEquals(metadata.get("DIF-Entry_ID"), "00794186-48f9-11e3-9dcb-00c0f03d5b7c");
        assertEquals(metadata.get("DIF-Metadata_Name"), "ACADIS IDN DIF");

        String content = handler.toString();
        assertContains("Title: Zamora 2010 Using Sediment Geochemistry", content);
        assertContains("Southernmost_Latitude : 78.833", content);
        assertContains("Northernmost_Latitude : 79.016", content);
        assertContains("Westernmost_Longitude : 11.64", content);
        assertContains("Easternmost_Longitude : 13.34", content);
    }