Bug 54570 - InvalidFormatException because of Absolute URI forbidden
Summary: InvalidFormatException because of Absolute URI forbidden
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 3.15-dev
Hardware: All All
: P2 minor (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-16 14:25 UTC by Mathis
Modified: 2016-05-16 21:06 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathis 2013-02-16 14:25:42 UTC
When trying to extract the text from a pptx document I get the following Exception:

Stack Trace: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Absolute URI forbidden: file://///...
	at org.apache.poi.openxml4j.opc.PackagePartName.throwExceptionIfAbsoluteUri(PackagePartName.java:426)
	at org.apache.poi.openxml4j.opc.PackagePartName.throwExceptionIfInvalidPartUri(PackagePartName.java:175)
	at org.apache.poi.openxml4j.opc.PackagePartName.<init>(PackagePartName.java:83)
	at org.apache.poi.openxml4j.opc.PackagingURIHelper.createPartName(PackagingURIHelper.java:493)
	at org.apache.poi.openxml4j.opc.PackagePart.getRelatedPart(PackagePart.java:483)
	at org.apache.poi.xslf.XSLFSlideShow.<init>(XSLFSlideShow.java:86)
	at org.apache.poi.xslf.extractor.XSLFPowerPointExtractor.<init>(XSLFPowerPointExtractor.java:61)

But the document can be opened by MS Office and LibreOffice. There are complains about some missing references but there is still most of the data in the document.

Unfortunately I can not attach the document.
Comment 1 Nick Burch 2013-02-16 14:38:24 UTC
Could you please unpack the file (.pptx is a zip of xml files) and post just the offending rels part? That'll let us see how the offending link has been created
Comment 2 Mathis 2013-02-16 15:41:28 UTC
Here is the offending part, in slideXX.xml.rels:

<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship TargetMode="External" Target="file:///\\<path>.xlsx!MSCI!%5bIndicator%20compilation.xlsx%5dMSCI%20Diagramm%201" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Id="rId3"/><Relationship Target="../slideLayouts/slideLayout2.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Id="rId2"/><Relationship Target="../drawings/vmlDrawing1.vml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing" Id="rId1"/><Relationship TargetMode="External" Target="file:///\\<path>.xlsx!OECD!%5bIndicator%20compilation.xlsx%5dOECD%20Diagramm%201" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Id="rId4"/></Relationships>
Comment 3 Andreas Beeker 2016-05-16 21:06:15 UTC
This was already fixed ... added a test case / sample file via r1744137
Please validate it with your own file.