# EPUB 3 package document

Source: https://xmlvalid.com/schemas/epub-3-package

> The package document of an EPUB 3 book: metadata, manifest and spine, checked with the grammar and rules epubcheck uses.

Every EPUB 3 book has one package document (usually OEBPS/content.opf or package.opf) listing its metadata, every file in the book and the reading order. Stores and reading systems reject a book whose package document is broken.
Two layers are checked: the RELAX NG grammar of epubcheck, then its Schematron rules (unique identifier, exactly one nav item, refines targets, rendition properties and so on).

- Type: RelaxNG Compact + Schematron
- Version: 3.0 to 3.3
- Namespace: `http://www.idpf.org/2007/opf`
- Root element: `package`
- Publisher: W3C EPUB 3 Community Group (epubcheck) (MIT (IDPF)), source: https://github.com/w3c/epubcheck/tree/main/src/main/resources/com/adobe/epubcheck/schema/30
- Rules: [EPUB 3 package rules (epubcheck) epubcheck 5](https://xmlvalid.com/rules/sets/epub-3-package)
- Validate against it: https://xmlvalid.com/validate?schema=epub-3-package

## Notes

- Drop the whole .epub on the validator's Upload tab to check the book file by file: container.xml, this package document, the NCX, and every XHTML, SVG and SMIL file of the manifest for well-formedness, plus the mimetype file and manifest files missing from the archive. CSS, fonts, links between files, media types and XHTML content rules are checked by epubcheck, not here.
- libxml2 mishandles the nested interleave of the original grammar and would reject a meta element placed between dc elements, which EPUB allows. The main file is a small wrapper by xmlvalid.com that includes package-30.rnc unchanged and writes that part as one flat interleave; both accept the same documents.
- The example is by xmlvalid.com.
