[ 
https://issues.apache.org/jira/browse/TIKA-2524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16285926#comment-16285926
 ] 

Tim Allison commented on TIKA-2524:
-----------------------------------

Ugh.  Looks like we need update our docs and/or add a parser for XPS.  Thank 
you for opening this and offering an example file.

>From OOXMLParser:
{noformat}
    /**
     * We claim to support all OOXML files, but we actually don't support a 
small
     * number of them.
     * This list is used to decline certain formats that are not yet supported
     * by Tika and/or POI.
     */
    protected static final Set<MediaType> UNSUPPORTED_OOXML_TYPES =
            Collections.singleton(
                    MediaType.application("vnd.ms-xpsdocument")
            );
{noformat}

> Apache Tika returns empty string when parsing text from XPS files
> -----------------------------------------------------------------
>
>                 Key: TIKA-2524
>                 URL: https://issues.apache.org/jira/browse/TIKA-2524
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.16
>            Reporter: Peter Davies
>              Labels: features
>         Attachments: doc_xps.xps
>
>
> When we parse XPS files using the AutoParser we always get an empty string.
> If we use DefaultDetector.detect() it correctly detects the MediaType as 
> "application/vnd.ms-xpsdocument".
> This page
> https://tika.apache.org/1.16/formats.html
> suggests that XPS (application/vnd.ms-xpsdocument) is supported however. 
> Our code:
>               InputStream bis = this.getClass().getResourceAsStream("/" + 
> EXPECTED_LOCATION + "doc_xps.xps");
>               Metadata metadata = new Metadata();
>               BodyContentHandler handler = new BodyContentHandler();
>               AutoDetectParser parser = new AutoDetectParser();
>               TikaInputStream tikaStream = TikaInputStream.get(bis);
>               parser.parse(tikaStream, handler, metadata);
>               String parsedText = handler.toString();
> I will attach doc_xps.xps if I can



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to