The Office Open XML file formats are a set of file formats that can be used to represent electronic office documents. There are formats for word processing documents, spreadsheets and presentations as well as specific formats for material such as mathematical formulas, graphics, bibliographies etc. The formats were developed by Microsoft and first appeared in Microsoft Office 2007. They were standardized between December 2006 and November 2008, first by the Ecma International consortium, where they became ECMA-376, and subsequently, after a contentious standardization process, by the ISO/IEC's Joint Technical Committee 1, where they became ISO/IEC 29500:2008.
Container
Office Open XML documents are stored in Open Packaging Conventions (OPC) packages, which are ZIP files containing XML and other data files, along with a specification of the relationships between them. Depending on the type of the document, the packages have different internal directory structures and names. An application will use the relationships files to locate individual sections (files), with each having accompanying metadata, in particular MIME metadata. A basic package contains an XML file called [Content_Types].xml at the root, along with three directories: _rels, docProps, and a directory specific for the document type (for example, in a .docx word processing package, there would be a word directory). The word directory contains the document.xml file which is the core content of the document.
[Content_Types].xml This file provided MIME type information for parts of the package, using defaults for certain file extensions and overrides for parts specified by IRI. _rels This directory contains relationships for the files within the package. To find the relationships for a specific file, look for the _rels directory that is a sibling of the file, and then for a file that has the original file name with a .rels appended to it. For example, if the content types file had any relationships, there would be a file called [Content_Types].xml.rels inside the _rels directory. _rels/.rels This file is where the package relationships are located. Applications look here first. Viewing in a text editor, one will see it outlines each relationship for that section. In a minimal document containing only the basic document.xml file, the relationships detailed are metadata and document.xml. docProps/core.xml This file contains the core properties for any Office Open XML document. word/document.xml This file is the main part for any Word document.
Relationships An example relationship file (word/_rels/document.xml.rels), is:
As such, images referenced in the document can be found in the relationship file by looking for all relationships that are of type http://schemas.microsoft.com/office/2006/relationships/image. To change the used image, edit the relationship. The following code shows an example of inline markup for a hyperlink:
In this example, the Uniform Resource Locator (URL) is in the Target attribute of the Relationship referenced through the relationship Id, "rId2" in this case. Linked images, templates, and other items are referenced in the same way. Pictures can be embedded or linked using a tag:
This is the reference to the image file. All references are managed via relationships. For example, a document.xml has a relationship to the image. There is a _rels directory in the same directory as document.xml, inside _rels is a file called document.xml.rels. In this file there will be a relationship definition that contains type, ID and location. The ID is the referenced ID used in the XML document. The type will be a reference schema definition for the media type and the location will be an internal location within the ZIP package or an external location defined with a URL.
Document properties Office Open XML uses the Dublin Core Metadata Element Set and DCMI Metadata Terms to store document properties. Dublin Core is a standard for cross-domain information resource description and is defined in ISO 15836:2003. An example document properties file (docProps/core.xml) that uses Dublin Core metadata, is:
Document markup languages An Office Open XML file may contain several documents encoded in specialized markup languages corresponding to applications within the Microsoft Office product line. Office Open XML defines multiple vocabularies using 27 namespaces and 89 schema modules. The primary markup languages are:
WordprocessingML for word-processing SpreadsheetML for spreadsheets PresentationML for presentations Shared markup language materials include:
Office Math Markup Language (OMML) DrawingML used for vector drawing, charts, and for example, text art (additionally, though deprecated, VML is supported for drawing) Extended properties Custom properties Variant Types Custom XML data properties Bibliography In addition to the above markup languages custom XML schemas can be used to extend Office Open XML.
Design approach Patrick Durusau, the editor of ODF, has viewed the markup style of OOXML and ODF as representing two sides of a debate: the "element side" and the "attribute side". He notes that OOXML represents "the element side of this approach" and singles out the KeepNext element as an example:
… excerpt ends here. Continue reading the full article.





