Package Structure包结构
A PresentationML or .pptx file is a zip file (a package) containing a number of "parts" (typically UTF-8 or UTF-16 encoded) or XML files. PresentationML或.pptx文件是一个zip文件(一个包),包含许多“部分”(通常是UTF-8或UTF-16编码的)或XML文件。The package may also contain other media files such as images. 该软件包还可能包含图像等其他媒体文件。The structure is organized according to the Open Packaging Conventions as outlined in Part 2 of the OOXML standard ECMA-376.该结构根据OOXML标准ECMA-376第2部分中概述的开放式打包约定进行组织。
You can look at the file structure and the files that comprise a PresentationML file by simply unzipping the .pptx file. 只需解压缩.pptx文件,就可以查看文件结构和组成PresentationML文件的文件。
The number and types of parts will vary based on what is in the presentation, but there will always be a [Content_Types].xml, one or more relationship (.rels) parts, and a presentation part (presentation.xml), which is located within the ppt folder for Microsoft Powerpoint files. 根据演示文稿中的内容,部分的数量和类型会有所不同,但总会有一个[Content_types].xml、一个或多个关系(.rels)部分和一个演示文稿部分(presentation.xml),它位于Microsoft Powerpoint文件的ppt文件夹中。Typically there will also be at least one slide part, together with a master slide and a layout slide from which the slide is formed.通常还将至少有一个幻灯片部分,以及形成幻灯片的主幻灯片和布局幻灯片。
Content Types内容类型
Every package must have a [Content_Types].xml, found at the root of the package. 每个包都必须有一个[Content_Types].xml,位于包的根目录下。This file contains a list of all of the content types of the parts in the package. 此文件包含包中零件的所有内容类型的列表。Every part and its type must be listed in [Content_Types].xml. 每个部件及其类型必须在[Content_Types].xml中列出。The following is a content type for a slide part:以下是幻灯片部分的内容类型:
<Override PartName="/ppt/slides/slide1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"/>
When adding new parts to the package, it is important to keep in mind that not only must you add the new part and update any relationships within .rels files, but also the Content_Types.xml file must be updated.在向包中添加新部件时,重要的是要记住,不仅必须添加新部件并更新.rels文件中的任何关系,还必须更新Content_Types.xml文件。
Relationships关系
Every package contains a relationships part that defines the relationships between the other parts and to resources outside of the package. 每个包都包含一个关系部分,该部分定义了其他部分之间以及与包外资源之间的关系。This separates the relationships from content and makes it easy to change relationships without changing the sources that reference targets.这将关系从内容中分离出来,使更改关系变得容易,而无需更改引用目标的源。

For an OOXML package, there is always a relationships part (.rels) within the _rels folder that identifies the starting parts of the package, or the package relationships. 对于OOXML包,在_rels文件夹中始终有一个关系部分(.rels),用于标识包的起始部分或包关系。For example, the following defines the identity of the start part for the content of a presentation:例如,以下定义了演示内容的开始部分的标识:
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="ppt/presentation.xml"/>.
There are also typically relationships within .rels for app.xml and core.xml.app.xml和core.xml的.rels中通常也存在关系。
In addition to the relationships part for the package, each part that is the source of one or more relationships will have its own relationships part. 除了包的关系部分外,作为一个或多个关系源的每个部分都有自己的关系部分。Each such relationship part is found within a _rels sub-folder of the part and is named by appending '.rels' to the name of the part.每个这样的关系部件都位于部件的_rels子文件夹中,并通过在部件名称后添加“_rels”来命名。
Typically the main content part (presentation.xml) has its own relationships part (presentation.xml.rels). 通常,主要内容部分(presentation.xml)有自己的关系部分(presentation.xml.rels)。It will contain relationships to the other parts of the content, such as slideMaster1.xml, notesMaster1.xml, handoutMaster1.xml, slide1.xml, presProps.xml, tableStyles.xml, theme1.xml, as well as the URIs for external links.它将包含与内容的其他部分的关系,例如slideMaster1xml、notesMaster1xml、handoutMaster1x ml、slide1xml、presPropsxml、tableStylesxml、themexml,以及外部链接的URI。

A relationship can be either explicit or implicit. 关系可以是显性的,也可以是隐性的。For an explicit relationship, a resource is referenced using the Id attribute of a <Relationship> element. 对于显式关系,使用<Relationship>元素的Id属性引用资源。That is, the Id in the source maps directly to an Id of a relationship item, with an explicit reference to the target. 也就是说,源中的Id直接映射到关系项的Id,并显式引用到目标。
For example, a slide might contain a hyperlink such as this:例如,幻灯片可能包含以下超链接:
The r:id="rId2" references the following relationship within the relationships part for the slide (slide1.xml.rels).r:id="rId2"引用幻灯片(slide1.xml.rels)的关系部分中的以下关系。
For an implicit relationship, there is no such direct reference to a <Relationship> Id. 对于隐式关系,没有直接引用<Relationship>Id。Instead, the reference is understood.相反,参考是可以理解的。
Parts Specific to PresentationML Documents演示文稿文档的特定部分
Below is a list of the possible parts of a PresentationML package that are specific to PresentationML presentations. 下面是PresentationML包中特定于PresentationML演示的可能部分的列表。Keep in mind that a presentation may only have a few of these parts. 请记住,演示文稿可能只有其中的几个部分。For example, if a presentation has no notes, then a notes master part will not be included in the package.例如,如果演示文稿没有注释,则说明文件包中不会包含注释主控部分。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Parts Shared by Other OOXML Documents其他OOXML文档共享的部分
There are a number of part types that may appear in any OOXML package. 任何OOXML包中都可能出现许多零件类型。Below are some of the more relevant parts for PresentationML documents.下面是一些与PresentationML文档更相关的部分。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|