use of org.apache.tika.sax.xpath.CompositeMatcher in project tika by apache.
the class OpenDocumentMetaParser method getMeta.
private static ContentHandler getMeta(ContentHandler ch, Metadata md, Property property, String element) {
Matcher matcher = new CompositeMatcher(META_XPATH.parse("//meta:" + element), META_XPATH.parse("//meta:" + element + "//text()"));
ContentHandler branch = new MatchingContentHandler(new MetadataHandler(md, property), matcher);
return new TeeContentHandler(ch, branch);
}
use of org.apache.tika.sax.xpath.CompositeMatcher in project tika by apache.
the class OpenDocumentMetaParser method getUserDefined.
private static ContentHandler getUserDefined(ContentHandler ch, Metadata md) {
Matcher matcher = new CompositeMatcher(META_XPATH.parse("//meta:user-defined/@meta:name"), META_XPATH.parse("//meta:user-defined//text()"));
// eg <meta:user-defined meta:name="Info1">Text1</meta:user-defined> becomes custom:Info1=Text1
ContentHandler branch = new MatchingContentHandler(new AttributeDependantMetadataHandler(md, "meta:name", Metadata.USER_DEFINED_METADATA_NAME_PREFIX), matcher);
return new TeeContentHandler(ch, branch);
}
Aggregations