What is OOXML?OOXML是什么?
Office Open XML, also known as OpenXML or OOXML, is an XML-based format for office documents, including word processing documents, spreadsheets, presentations, as well as charts, diagrams, shapes, and other graphical material. Office Open XML,也称为OpenXML或OOXML,是一种基于XML的Office文档格式,包括字处理文档、电子表格、演示文稿以及图表、图表、形状和其他图形材料。The specification was developed by Microsoft and adopted by ECMA International as ECMA-376 in 2006. 该规范由Microsoft开发,并于2006年被ECMA International采用为ECMA-376。A second version was released in December, 2008, and a third version of the standard released in June, 2011. 第二个版本于2008年12月发布,第三个版本于2011年6月发布。The specification has been adopted by ISO and IEC as ISO/IEC 29500.本规范已被ISO和IEC采用为ISO/IEC 29500。
It is important to keep in mind that OOXML is not the same as Open Office XML or the Open Document Format (ODF) that underlies the OpenOffice.org and other open source office software. 请务必记住,OOXML与Open Office XML或OpenDocument Format(ODF)不同,后者是OpenOffice.org和其他开源办公软件的基础。Office Open XML and Open Office XML or ODF are in some sense competing XML standards for office documents.从某种意义上讲,Office Open XML和Open Office XML或ODF是Office文档的竞争XML标准。
Although the older binary formats (.doc, xls, and .ppt) continue to be supported by Microsoft, OOXML is now the default format of all Microsoft Office documents (.docx, .xlsx, and .pptx).虽然Microsoft仍然支持旧的二进制格式(.doc、xls和.ppt),但OOXML现在是所有Microsoft Office文档(.docx、.xlsx和.pptx)的默认格式。
What does OOXML specify?OOXML指定了什么?
Markup specifications标记规范
ECMA-376 includes three different specifications for each of the three main office document types--WordprocessingML for word processing documents, SpreadsheetML for spreadsheet documents, and PresentationML for presentation documents. ECMA-376为三种主要的office文档类型中的每一种都包括三种不同的规范——文字处理文档的WordprocessingML、电子表格文档的SpreadsheetML和演示文档的PresentationML。It also includes some supporting markup languages, most importantly DrawingML for drawings, shapes and charts.它还包括一些支持标记语言,最重要的是用于绘图、形状和图表的DrawingML。
The specification includes both XML schemas and constraints in written form. 该规范包括XML模式和书面形式的约束。Any conforming document must conform to XML schemas, and be in UTF-8 or UTF-16 encoding. 任何符合要求的文档必须符合XML模式,并采用UTF-8或UTF-16编码。The specification does include some extensibility mechanisms allowing custom XML to be stored with the OOXML markup.该规范确实包含一些可扩展性机制,允许使用OOXML标记存储自定义XML。
A file packaging specification文件打包规范
In addition to the markup language specifications, Part 2 of ECMA-376 specifies the Open Packaging Conventions (OPC). 除标记语言规范外,ECMA-376第2部分还规定了开放式包装约定(OPC)。OPC is a container-file technology leveraging the common ZIP format for combining files into a common package. OPC是一种容器文件技术,利用公共ZIP格式将文件组合到一个公共包中。So OOXML files are ZIP archives containing various XML files (parts) and organized into single package. 所以OOXML文件是包含各种XML文件(部分)的ZIP归档文件,并被组织到单个包中。This breaking up or chunking of the data into pieces makes it easier and quicker to access data and reduces the chances of data corruption. 这种将数据分解或分块的方式使访问数据更容易、更快,并减少了数据损坏的机会。The parts can contain any type of data; to keep track of the data type of each part without relying on file extensions, the type for each part is specified in a file within the package called [Content_Types].xml. 零件可以包含任何类型的数据;为了在不依赖文件扩展名的情况下跟踪每个部件的数据类型,在名为[Content_Types].xml的包中的文件中指定了每个部件的类型。The relationships of the parts to the package as well as relationships that any part may have are abstracted from the parts and stored separately in relationship files--one for the package as a whole and one for each package that has relationships. 部件与包的关系以及任何部件可能具有的关系从部件中抽象出来,并分别存储在关系文件中——一个用于整个包,另一个用于具有关系的每个包。In this way references are stored only once and can therefor be easily changed when necessary.这样,引用只存储一次,因此在必要时可以很容易地进行更改。