private Metadata extract(String xmpFileName) throws IOException, TikaException, SAXException {
        try (InputStream is = getResourceAsStream("/test-documents/xmp/" + xmpFileName)) {
            Document doc = XMLReaderUtils.buildDOM(is);
            XMPMetadata xmp = new XMPMetadata(doc);
            ParseContext context = new ParseContext();
            Metadata metadata = new Metadata();
            PDMetadataExtractor.extract(xmp, metadata, context);
            return metadata;
        }
    }
This tests our custom schemas and PDF/A
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-pdf-module/src/test/java/org/apache/tika/parser/pdf/CustomTikaXMPTest.java