This specification defines a file format and processing model for packaging the set of related resources that comprise a Web Publication into a single-file container, the Web Publication Lightweight Package.

Introduction

A Web Publication Lightweight Package is used:

Terminology

Terms with meanings specific to the publishing industry are capitalized in this document (e.g., "Reading System"). A complete list of these terms and definitions is provided in [[!WEBPUB1]].

Only the first instance of a term in a section is linked to its definition.

In addition, the following terminology is defined for use in this specification:

File Name

The name of any type of file or directory within a Web Publication Lightweight Package.

File Path

The position of a file or directory within a Web Publication Lightweight Package, represented as string of characters in which path components, separated by the delimiting character / (U+002F), represent each directory.

LPF Processor

A software application that processes Web Publication Lightweight Packages according to the requirements of this specification.

Package

In this specification, alias to Web Publication Lightweight Package.

Primary Entry Page

(see def in the Web Publication specification).

Root Directory

The base of the Package file system. This directory is virtual in nature: an LPF Processor might or might not generate a physical root directory for the contents of the Package if the contents are unzipped.

User Agent

A User Agent ...

Web Publication

A Web Publication ...

Web Publication Manifest

(see def in the Web Publication specification).

Specification

ZIP File Requirements

A Web Publication Lightweight Package uses the ZIP format as specified in ISO/IEC 21320-1:2015 ([[!ZIP]]).

File and Directory Structure

A Package MUST include at least one of the following files in its Root Directory:

The contents of both files are specified in [[!WEBPUB]].

If both entry.html and manifest.jsonld are present in the package, the former MUST contain a reference to the latter.

All other files within the Package MAY be in any location descendant from the Root Directory.

Relative IRIs for Referencing Other Components

Files within the Package MUST reference each other via relative IRI references, as specified in [[!RFC3987]].

Some language specifications reference Requests For Comments [[RFC]] that preceded [[RFC3987]], in which case the earlier RFC applies for content in that particular language.

All relative IRI references MUST resolve to resources within the Package (i.e. at or below the Root Directory).

The [[!ZIP]] specification has few constraints on the characters allowed for file and dirctory names. When crafting such names, authors must be careful to use characters which allow a broad interoperability among operating systems and are compatible with relative IRI references.

For relative IRI references, the Base URI [[!RFC3986]] is determined by the relevant language specifications for the given file formats.

For example, CSS defines how relative IRI references work in the context of CSS style sheets and property declarations [[!CSSSnapshot]].

The Base URIs expressed within the manifest.jsonld file use the Root Directory of the Package as the default Base URI.

User Agent Conformance

An LPF compliant User Agent MUST meet all of the following criteria:

The application/wpub+zip Media Type

This appendix registers the media type application/wpub+zip for the Lightweight Packaging Format (LPF).

A Lightweight Packaging Format (or LPF) file is a container technology based on the [[!ZIP]] archive format. It is used to encapsulate Web Publications. LPF and its related standards are maintained and defined by the World Wide Web Consortium (W3C).

MIME media type name:

application

MIME subtype name:

wpub+zip

Required parameters:

None.

Optional parameters:

None.

Encoding considerations:

LPF files are binary files encoded in the application/zip media type.

Security considerations:

All processors that read LPF files should rigorously check the size and validity of data retrieved.

In addition, because of the various content types that can be embedded in LPF files , application/wpub+zip may describe content that poses security implications beyond those noted here. However, only in cases where the processor recognizes and processes the additional content, or where further processing of that content is dispatched to other processors, would security issues potentially arise. In such cases, matters of security would fall outside the domain of this registration document.

Security considerations that apply to application/zip also apply to LPF files.

Interoperability considerations:

None.

Published specification:

This media type registration is for the Lightweight Packaging Format (LPF), as described by the Lightweight Packaging Format (LPF) 1.0 specification located at https://github.com/w3c/LPFub/spec/ocf-lite.html.

Applications that use this media type:

This media type will soon be in wide use for the distribution of audio and visual publications. The following list of applications is not exhaustive.

Additional information:
Magic number(s):

0: PK 0x03 0x04

File extension(s):

LPF files are most often identified with the extension .lpf.

Macintosh file type code(s):

ZIP

Fragment identifiers:

None

Person & email address to contact for further information:

public-publ-wg@w3.org

Intended usage:

COMMON

Author/change controller:

The published specification is a work product of the World Wide Web Consortium (W3C)’s Publishing Working Group. The W3C has change control over this specification.