PresentationXML.com
 

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文件的文件。PresentationML file structure

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.这将关系从内容中分离出来,使更改关系变得容易,而无需更改引用目标的源。

package relationships part

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。

document relationships part

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:例如,幻灯片可能包含以下超链接:

<a:hlinkClick r:id="rId2">

The r:id="rId2" references the following relationship within the relationships part for the slide (slide1.xml.rels).r:id="rId2"引用幻灯片(slide1.xml.rels)的关系部分中的以下关系。

<Relationship Id="rId2" Type="http://. . ./hyperlink" Target="http://www.google.com/" TargetMode="External"/>

For an implicit relationship, there is no such direct reference to a <Relationship> Id. 对于隐式关系,没有直接引用<Relationship>IdInstead, 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.例如,如果演示文稿没有注释,则说明文件包中不会包含注释主控部分。

Part部分 Description描述
Comments Authors注释作者

Contains information about each author who has added a comment to the presentation.包含每个在演示文稿中添加评论的作者的信息。

Comments注释

Contains comments for a single slide.包含单个幻灯片的注释。

Handout Master讲义母版

Contains the look, position, and size of the slides, notes, header and footer text, date, or page number on the presentation's handout. 包含演示文稿讲义上幻灯片、注释、页眉和页脚文本、日期或页码的外观、位置和大小。There can be only one such part.这样的部分只能有一个。

Notes Master笔记大师

Contains information about the content and formatting of all notes pages. 包含有关所有notes页面的内容和格式的信息。There can be only one such part.这样的部分只能有一个。

Notes Slide笔记幻灯片

Contains the notes for a single slide.包含一张幻灯片的注释。

Presentation演示

Contains the definition of a slide presentation. 包含幻灯片演示文稿的定义。There must be one and only one such part. 这样的一部分肯定只有一个。See Presentation.请参阅演示文稿

Presentation Properties演示文稿属性

Contains all of the presentation's properties. 包含演示文稿的所有属性。There must be one and only one such part.这样的一部分肯定只有一个。

Slide滑动

Contains the content of a single slide.包含一张幻灯片的内容。

Slide Layout幻灯片布局

Contains the definition for a slide template. 包含幻灯片模板的定义。It defines the default appearance and positioning of drawing objects on the slide. 它定义了幻灯片上图形对象的默认外观和位置。There must be one or more such parts.必须有一个或多个这样的部件。

Slide Master幻灯片母版

Contains the master definition of formatting, text, and objects that appear on each slide in the presentation that is derived from the slide master. 包含格式、文本和对象的主定义,这些内容出现在从幻灯片母版派生的演示文稿中的每张幻灯片上。There must be one or more such parts.必须有一个或多个这样的部件。

Slide Synchronization Data幻灯片同步数据

Contains properties specifying the current state of a slide that is being synchronized with a version of the slide stored on a central server.包含指定与存储在中央服务器上的幻灯片版本同步的幻灯片的当前状态的属性。

User-Defined Tags用户定义的标签

Contains a set of user-defined properties for an object in a presentation. 包含演示文稿中对象的一组用户定义属性。There can be zero or more such parts.这样的部件可以是零个或多个。

View Properties查看属性

Contains display properties for the presentation.包含演示文稿的显示属性。

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文档更相关的部分。

Part部分 Description描述
Audio音频

Contains an audio file associated wtih a handout master, notes slide, slide, slide layout, or slide master.包含与讲义母版、笔记幻灯片、幻灯片、幻灯片布局或幻灯片母版关联的音频文件。

Embedded Control嵌入式控件

Contains information about an embedded control.包含有关嵌入式控件的信息。

Embedded Object嵌入式对象

Contains information about an embedded object on a slide. 包含有关幻灯片上嵌入对象的信息。For example, a slide could contain an embedded video or audio object.例如,幻灯片可以包含嵌入式视频或音频对象。

Embedded package嵌入式软件包

Contains a complete package, either internal or external to the referencing package. 包含引用包内部或外部的完整包。For example, a PresentationML document might contain a SpreadsheetML document.例如,PresentationML文档可能包含SpreadsheetML文档。

Extended File Properties (often found at docProps/app.xml)扩展文件属性(通常在docProps/app.xml中找到)

Contains properties specific to an OOXML document--properties such as the template used, the number of slides and words, and the application name and version.包含特定于OOXML文档的属性——例如使用的模板、幻灯片和单词的数量以及应用程序名称和版本。

File Properties, Core文件属性,核心

Core file properties enable the user to discover and set common properties within a package--properties such as creator name, creation date, title. 核心文件属性使用户能够发现和设置包中的公共属性——例如创建者名称、创建日期、标题等属性。Dublin Core properties (a set of metadate terms used to describe resources) are used whenever possible.尽可能使用属性(一组用于描述资源的元数据术语)。

Image形象

Presentations often contain images. 演示文稿通常包含图像。An image can be stored in a package as a zip item. 图像可以作为zip项目存储在包中。The item must be identified by an image part relationship and the appropriate content type.项目必须通过图像部分关系和适当的内容类型来标识。

Theme主题

DrawingML is a shared language across the OOXML document types. DrawingML是一种跨OOXML文档类型的共享语言。It includes a theme part that is included in SpreadsheetML documents when the spreadsheet uses a theme. 它包括一个主题部分,当电子表格使用主题时,该部分包含在SpreadsheetML文档中。The theme part contains information about a document's theme, that is, such information as the color scheme, font and format schemes.主题部分包含有关文档主题的信息,即颜色方案、字体和格式方案等信息。

Video视频

Contains a video file associated wtih a handout master, notes slide, slide, slide layout, or slide master.包含与讲义母版、笔记幻灯片、幻灯片、幻灯片布局或幻灯片母版关联的视频文件。