You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2020/05/27 12:43:13 UTC

[Bug 64473] OPCPackage.open(fileName, PackageAccess.READ) does not open valid xlsx file

https://bz.apache.org/bugzilla/show_bug.cgi?id=64473

Eugene <be...@bk.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Eugene <be...@bk.ru> ---
Also pay attention to the documentation. I found only the draft version, but I
think that the difference there is not big.

https://www.ecma-international.org/activities/Office%20Open%20XML%20Formats/Draft%20ECMA-376%203rd%20edition,%20March%202011/Office%20Open%20XML%20Part%202%20-%20Open%20Packaging%20Conventions.pdf

item 9.1.1.4 Part Naming 


A package implementer shall neither create nor recognize a part with apart name
derived from another part name by appending segments to it. [M1.11][Example:If
a package contains a part named“/segment1/segment2/.../segmentn”, then other
parts in that packageshall not have names such as: “/segment1”,
“segment1/segment2”, or “/segment1/segment2/.../segmentn-1”. endexample]

But also look at the item:

9.1.1 Part Names
Each part has a name. Part namesrefer to parts within a package. [Example:The
part name “/hello/world/doc.xml” contains three segments: “hello”, “world”, and
“doc.xml”.The first two segments in the sample represent levelsin the logical
hierarchy and serve to organize the parts of the package, whereas the 
ECMA-376 Part214third contains actual content.Note that segments are not
explicitly representedas foldersin the package model, and no directory of
folders exists in the package model.end example]

In this example, “doc.xml” the name of this file is considered along with the
extension, whereas in the POI in the class PackagePartCollection in method
PackagePart put (final PackagePartName partName, final PackagePart part)

Comparison is made only by file names, not considering their extension, which
is possibly a mistake.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org