FANDOM


Open Packaging Convention
Blank

Developed by Microsoft +, Ecma International +, ISO/IEC +
Initial release December 7, 2006
Latest release ISO/IEC 29500:2008
Type Archive
data compression
Standard ECMA-376, ISO/IEC 29500
Website ECMA-376,
ISO/IEC 29500:2008
File formats category - v  e   edit
Smallwikipedialogo.png Wikipedia has an article related to:

The Open Packaging Conventions (OPC) is a file packaging format created by Microsoft for storing a combination of XML and non-XML files that together form a single entity in a single compressed file container. This format combines the advantages of leaving the independent file entities embedded in the document intact and resulting in much smaller files compared to normal use of XML.

The OPC is specified in Part 2 of the Office Open XML standards ISO/IEC 29500:2008 and ECMA-376.[1][2]

Examples of file formats following the OPC are XPS, WordprocessingML files, SpreadsheetML files, and PresentationML files.

FormatEdit

A file following the OPC is a standard ZIP archive consisting of files, or parts. The file itself (which contains the parts) is called a package. Individual parts may be related to other parts in the package or external files through relationships.

PartsEdit

Parts specify individual information or objects in the package. For example, in a presentation, each slide is represented by its own part.

RelationshipsEdit

Relationships are of two types:

  • Package-level relationships, which specify relationships between the package itself and a part in it (internal) or an external resource. These may be used for example to refer to the main part in the package.
  • Part-level relationships, which specify relationships between a part and another part (internal) or an external resource.

The root _rels folder contains the package-level relationships for the file. The _rels\.rels file in that folder is an XML file contains the relationships. (Parts are typically XML files, and tags usually have names in "proper case", as in "Proper Case".) A .rels file typically takes the following form (this is from an MS Word document):

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
    <Relationship Id="rId1" Type="http://..." Target="word/document.xml" />
     ...
</Relationships>

Part-level relationships may be found in any other .rels file or _rels folder.

Content typesEdit

A [Content_Types].xml file in the root defines the different file formats used in the package. Example:

<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
    <!-- defines that files ending in .jpeg are of Internet media type "image/jpeg".
         See the Internet media type article for more info. -->
    <Default Extension="jpeg" ContentType="image/jpeg"/>
    <!-- defines the type of .rels files. (see above) -->
    <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
    <!-- defines the type of .xml files. -->
    <Default Extension="xml" ContentType="application/xml"/>
    <!-- overrides the processing of the type for a specific part. -->
    <Override PartName="/word/document.xml"
              ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
    ...
</Types>

Note that types for specific parts may be overridden using the Override tag, which overrides any Default tag for the file type.

ProcessingEdit

Files using the OPC can be opened using ordinary ZIP utilities. Open source libraries for .NET and Java are available for using Open Packaging Conventions. The .NET Framework, versions 3.0 and 3.5, contains the WindowsBase component, which can process ZIP packages and abstract classes for packages, using classes in the System.IO.Package namespace. An SDK is also available.

ReferencesEdit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.