RNC W3C EPUB 3 Community Group (epubcheck) · 3.0 to 3.3

EPUB container.xml

OCF container (META-INF/container.xml)

The META-INF/container.xml of an EPUB, which tells reading systems where the package document is.

About

A reading system opens META-INF/container.xml first and follows its rootfile to the package document. EPUB 2 and EPUB 3 use the same container format.

Good to know

  • On its own, whether the rootfile path exists inside the .epub is not checked; drop the whole .epub on the validator's Upload tab and it is.
  • The example is by xmlvalid.com.

Files

3 files · 9.9 KB

The validator loads all of these with their folder structure, so includes and imports resolve as published.

Example document

container.xml · 343 B · valid against this schema

In CI and from code

The same schema by its name, epub-ocf-container, through the API.

npx @xmlvalid/cli validate "**/*.xml" --schema epub-ocf-container
- uses: xmlvalid/validate-action@v1
  with:
    files: "**/*.xml"
    schema: epub-ocf-container
    api-key: ${{ secrets.XMLVALID_API_KEY }}
curl https://xmlvalid.com/api/v1/validations \
  -H "Authorization: Bearer $XMLVALID_API_KEY" \
  -F document={{ $schema->example ?? 'document.xml' }} -F schema=epub-ocf-container

Free accounts get 100 API validations a month. On Pro, a URL monitor can check a published document against this schema every hour and email you when it breaks. More CI setups