[ https://issues.apache.org/jira/browse/TIKA-2404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16070440#comment-16070440 ]
Jorge Spinsanti commented on TIKA-2404: --------------------------------------- Yes, you are right again. We are applying your suggestion and moving to use SAX-based docx parser. > XMLException in DOCX->TXT conversion > ------------------------------------ > > Key: TIKA-2404 > URL: https://issues.apache.org/jira/browse/TIKA-2404 > Project: Tika > Issue Type: Bug > Components: parser > Affects Versions: 1.15 > Reporter: Jorge Spinsanti > Labels: sax_docx_fixes > Attachments: XmlException.docx > > > I got an XMLException when try to extract text from DOCX file (see attached > file): > {code} > Caused by: org.apache.tika.exception.TikaException: Unexpected > RuntimeException from > org.apache.tika.parser.microsoft.ooxml.OOXMLParser@1de6e9d6 > at > org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:282) > at > org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) > ... 16 more > Caused by: org.apache.poi.POIXMLException: org.apache.xmlbeans.XmlException: > Element hdr@http://schemas.openxmlformats.org/wordprocessingml/2006/main is > not a valid ftr@http://schemas.openxmlformats.org/wordprocessingml/2006/main > document or a valid substitution. > at > org.apache.poi.xwpf.usermodel.XWPFFooter.onDocumentRead(XWPFFooter.java:121) > at > org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:196) > at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:190) > at > org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:112) > at > org.apache.poi.xwpf.extractor.XWPFWordExtractor.<init>(XWPFWordExtractor.java:58) > at > org.apache.poi.extractor.ExtractorFactory.createExtractor(ExtractorFactory.java:232) > at > org.apache.tika.parser.microsoft.ooxml.OOXMLExtractorFactory.parse(OOXMLExtractorFactory.java:104) > at > org.apache.tika.parser.microsoft.ooxml.OOXMLParser.parse(OOXMLParser.java:106) > at > org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) > ... 23 more > Caused by: org.apache.xmlbeans.XmlException: Element > hdr@http://schemas.openxmlformats.org/wordprocessingml/2006/main is not a > valid ftr@http://schemas.openxmlformats.org/wordprocessingml/2006/main > document or a valid substitution. > at > org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:322) > at > org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1384) > at > org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1363) > at > org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:370) > at org.apache.poi.POIXMLTypeLoader.parse(POIXMLTypeLoader.java:144) > at > org.openxmlformats.schemas.wordprocessingml.x2006.main.FtrDocument$Factory.parse(Unknown > Source) > at > org.apache.poi.xwpf.usermodel.XWPFFooter.onDocumentRead(XWPFFooter.java:96) > {code} > If I use OpenOffice, the text can be get sucessfully. -- This message was sent by Atlassian JIRA (v6.4.14#64029)