3.3 Content Types (as used in EPC)

Topic Version1Published09/15/2014
For StandardEPC v1.0

The file named [Content_Types].xml is used to associate file name extensions used in the package with specific mime content type. For general information about Content Types in OPC, see 2.2.1 Content Type (Defined by OPC). Some examples of how mime type can be used:

  • For XML content: If you have multiple versions of an Energistics ML file inside the same EPC container, you can use the mime type to determine which documents to validate (i.e., if you don’t support a certain version of an Energistics standard, then you don’t have to validate those files).
  • For non-XML content (such as PDF or application files, such as .docx): the mime type provides a hint to the operating system about which viewers and editors support the content.

The following code sample from RESQML shows examples of content types specified for an EPC file.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default 
Extension="rels" 
ContentType="application/vnd.openxmlformats-package.relationships+xml" />
<Override 
PartName="/docProps/core.xml" 
ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
<Override 
PartName="/EpcExternalPartReference_63f74a6b-6ac5-405c-843a-b82ef8f89b33.xml"
ContentType="application/x-resqml+xml;version=2.0;type=EpcExternalPartReference"/>
</Types>

Use these rules to define content in the EPC file:

  • [ContentTypes].xml is mandatory in OPC, so is mandatory in EPC.
  • An optional media folder may contain any type of media file—no restrictions. For example, it can be used to store any type of supporting documents you might want to include in an EPC file, such as graphics, videos, reports, etc.).
  • Each XML data object part must have a describing 'contentType'. The content type must follow rfc 2616: http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 and must have the following format:

application/x-<energisticsStandard>+xml;version=<versionNumber>;type=<objectType>

where:

  • energisticsStandard is the name of the standard used, e.g. “resqml” or “witsml” or “prodml”
  • versionNumber is the major schema version number used, e.g. “2.0”
  • objectType is the XML Schema type of the root element of the XML data object

Examples are:


"application/x-resqml+xml;version=2.0;type=EpcExternalPartReference"
"application/x-resqml+xml;version=2.0;type=FaultInterpretation"
"application/x-resqml+xml;version=2.0;type=TriangulatedSetRepresentation"