Creating Arbitrary EPUB OPF Metadata

The OPF package manifest within an EPUB document can contain metadata entries. The entries required for EPUB validation are created automatically by the EPUB generation process. However, you may want or need to add additional metadata, for example to support the conventions of a particular EPUB reader.

You can create arbitrary OPF metadata entries by creating a <data> element in your map's metadata with the name "opf-metadata". Use child <data> elements to define specific metadata items, where the @name value is is used as the @name attribute on the OPF <meta> and the @@value or content of the <data> element is used as the @content attribute on the OPF <meta> element.

For example, this markup in a DITA map:
  <data name="opf-metadata">
    <data name="item-one" value="value one"/>
    <data name="item-two" value="value two"/>
Would result in OPF metadata like this:
      <dc:title>DITA For Publishers User Guide</dc:title>
      <dc:language id="language">en-US</dc:language>
      <dc:identifier id="bookid"></dc:identifier>
      <dc:creator opf:role="aut">W. Eliot Kimber</dc:creator>
      <meta name="item-one" content="value one"/>
      <meta name="item-two" content="value two"/>