Search in sources :

Example 1 with AttributeMetadataHandler

use of org.apache.tika.parser.xml.AttributeMetadataHandler in project tika by apache.

the class OpenDocumentMetaParser method getStatistic.

private static ContentHandler getStatistic(ContentHandler ch, Metadata md, Property property, String attribute) {
    Matcher matcher = META_XPATH.parse("//meta:document-statistic/@meta:" + attribute);
    ContentHandler branch = new MatchingContentHandler(new AttributeMetadataHandler(META_NS, attribute, md, property), matcher);
    return new TeeContentHandler(ch, branch);
}
Also used : CompositeMatcher(org.apache.tika.sax.xpath.CompositeMatcher) Matcher(org.apache.tika.sax.xpath.Matcher) MatchingContentHandler(org.apache.tika.sax.xpath.MatchingContentHandler) TeeContentHandler(org.apache.tika.sax.TeeContentHandler) MatchingContentHandler(org.apache.tika.sax.xpath.MatchingContentHandler) TeeContentHandler(org.apache.tika.sax.TeeContentHandler) ContentHandler(org.xml.sax.ContentHandler) AttributeMetadataHandler(org.apache.tika.parser.xml.AttributeMetadataHandler)

Example 2 with AttributeMetadataHandler

use of org.apache.tika.parser.xml.AttributeMetadataHandler in project tika by apache.

the class OpenDocumentMetaParser method getStatistic.

@Deprecated
private static ContentHandler getStatistic(ContentHandler ch, Metadata md, String name, String attribute) {
    Matcher matcher = META_XPATH.parse("//meta:document-statistic/@meta:" + attribute);
    ContentHandler branch = new MatchingContentHandler(new AttributeMetadataHandler(META_NS, attribute, md, name), matcher);
    return new TeeContentHandler(ch, branch);
}
Also used : CompositeMatcher(org.apache.tika.sax.xpath.CompositeMatcher) Matcher(org.apache.tika.sax.xpath.Matcher) MatchingContentHandler(org.apache.tika.sax.xpath.MatchingContentHandler) TeeContentHandler(org.apache.tika.sax.TeeContentHandler) MatchingContentHandler(org.apache.tika.sax.xpath.MatchingContentHandler) TeeContentHandler(org.apache.tika.sax.TeeContentHandler) ContentHandler(org.xml.sax.ContentHandler) AttributeMetadataHandler(org.apache.tika.parser.xml.AttributeMetadataHandler)

Aggregations

AttributeMetadataHandler (org.apache.tika.parser.xml.AttributeMetadataHandler)2 TeeContentHandler (org.apache.tika.sax.TeeContentHandler)2 CompositeMatcher (org.apache.tika.sax.xpath.CompositeMatcher)2 Matcher (org.apache.tika.sax.xpath.Matcher)2 MatchingContentHandler (org.apache.tika.sax.xpath.MatchingContentHandler)2 ContentHandler (org.xml.sax.ContentHandler)2