This document is a human-readable version of the XSLTs that converts between HTML and DTBook inside the nordic EPUB3/DTBook migrator. The DTBook version used in this mapping and the nordic EPUB3/DTBook migrator is 2005-3. The EPUB that results from converting from DTBook to EPUB3 will contain multiple content documents. The XSLTs perform the conversion to a single-document HTML5 version, and the document is thereafter split into several documents. The document you are currently reading only describes the conversion between the single-document HTML version and the DTBook.
While the document focuses on the nordic DTBook profile, comments are provided to suggest how a conversion can be performed against generic DTBook files.
Global attributes (such as id
, class
and lang
)
are not described in this table, unless they are mapped in a special way.
HTML element | Examples and descriptions for converting to HTML | Examples and descriptions for converting to DTBook | DTBook element |
---|---|---|---|
HTML: html | <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html> <html xmlns:nordic="http://www.mtm.se/epub/" xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="z3998: http://www.daisy.org/z3998/2012/vocab/structure/#"></html>The nordic namespace and the epub:prefix
attribute is required to be present in the nordic EPUB3 profile,
and is added when converting from DTBook. The z3998 epub:type
makes available
several
additional epub:type values, which is used in this mapping.
|
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE dtbook PUBLIC "-//NISO//DTD dtbook 2005-3//EN" "http://www.daisy.org/z3986/2005/dtbook-2005-3.dtd"> <dtbook version="2005-3"></dtbook> The nordic EPUB3/DTBook migrator is a Pipeline 2 script, and will use the built-in modules in Pipeline 2 to upgrade earlier versions of DTBook to 2005-3 automatically (when using DTBook as input). |
DTBook: dtbook |
HTML: head | <head></head> |
<head profile="{from HTML link element with rel=profile}"></head> |
DTBook: head |
HTML: style | <style></style> |
Element is deleted. It does not exist in DTBook. | |
HTML: title | <title>...</title> |
<meta name="dc:Title" content="..."/> |
DTBook: meta
|
HTML: meta |
<meta name="..." content="..." http-equiv="..."/> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width"/> <meta name="dc:identifier" content="1234"/> <meta name="nordic:guidelines" content="2015-1"/> <meta name="nordic:supplier" content="..."/> <!-- DTBook dc:format is dropped --> In addition:
|
<meta name="..." content="..." http-equiv="..."></meta> <!-- HTML meta with missing name or content is dropped --> <!-- HTML meta with name="viewport" is dropped --> <meta name="dtb:uid" content="1234"/> <meta name="track:Guidelines" content="2011-2"/> <meta name="track:Supplier" content="..."/> <meta name="dc:format" content="DTBook"/> In addition:
|
DTBook: meta |
HTML: link | <link/> |
<link/> is not allowed in the nordic DTBook profile, so it is deleted. Disregarding the nordic DTBook profile, one could copy the element directly, including all the href , hreflang , type , rel and media attributes, but dropping the sizes attribute. |
DTBook: link |
HTML: body | <body> <section epub:type="cover"></section> <section epub:type="frontmatter" id="a"></section> <section epub:type="bodymatter" id="b"></section> <section epub:type="backmatter" id="c"></section> </body> There are no HTML element equivalent to the DTBook
frontmatter, bodymatter and rearmatter. However, there
are equivalent epub:type values; frontmatter,
bodymatter and backmatter. Each
HTML The exception to this rule is DTBook
|
<book> <frontmatter> <level1 class="cover"></level1> <level1 id="a"></level1> </frontmatter> <bodymatter> <level1 id="b"></level1> </bodymatter> <rearmatter> <level1 id="c"></level1> </rearmatter> </book> All top-level HTML All top-level HTML All top-level HTML |
DTBook: book |
The DTBook |
<frontmatter></frontmatter> |
DTBook: frontmatter | |
The DTBook |
<bodymatter></bodymatter> |
DTBook: bodymatter | |
The DTBook |
<rearmatter></rearmatter> |
DTBook: rearmatter | |
HTML: section
HTML: article |
<section epub:type="DIVISION PARTITION"></section> <article></article> Top-level HTML The top-level HTML cover , frontmatter ,
bodymatter , backmatter . It
must also state one of the following division types:
acknowledgments , afterword , appendix ,
assessment , bibliography , z3998:biographical-note ,
chapter , colophon , conclusion ,
contributors , copyright-page , dedication ,
z3998:discography , division , z3998:editorial-note ,
epigraph , epilogue , errata ,
z3998:filmography , footnotes , foreword ,
glossary , z3998:grant-acknowledgment , halftitlepage ,
imprimatur , imprint , index , index-group ,
index-headnotes , index-legend , introduction ,
landmarks , loa , loi , lot ,
lov , notice , other-credits , page-list ,
part , practices , preamble , preface ,
prologue , z3998:promotional-copy , z3998:published-works ,
z3998:publisher-address , qna , rearnotes ,
revision-history , z3998:section , standard ,
subchapter , z3998:subsection , titlepage ,
toc , z3998:translator-note , volume or warning .
If a section states the epub:type part , then all of its children must
also state one of the division types.
The division type is used to split the sections into multiple HTML files
in the nordic EPUB3 to DTBook migrator.
|
<level[1-6] class="PARTITION"></level[1-6]> <level[1-6] class="article"></level[1-6]> |
DTBook: level
DTBook: level1 DTBook: level2 DTBook: level3 DTBook: level4 DTBook: level5 DTBook: level6 |
HTML: br | <br/> |
<br/> |
DTBook: br |
HTML: p
|
<p class="line"></p> |
<line></line> |
DTBook: line |
HTML: span
|
<span class="linenum"></span> |
<linenum></linenum> |
DTBook: linenum |
HTML: address | <address></address> |
<p class="address"></p>
|
DTBook: address |
HTML: div | <div></div> |
<div></div> |
DTBook: div |
HTML: aside
|
<aside epub:type="z3998:production" class="{'render-required' if the DTBook render attribute is 'required'; or 'render-optional' if the DTBook render attribute is 'optional'}"> </aside> |
<prodnote render="{'required' if there is a 'render-required' HTML class, 'optional' otherwise}" imgref="{if there is one or more HTML img longdesc referring to the HTML aside, make the DTBook prodnote refer to those imgs}" > </prodnote> |
DTBook: prodnote |
HTML: section
Where the parent element has |
<section epub:type="cover"> <section class="one of: 'frontcover', 'rearcover', 'leftflap', 'rightflap' and also; 'render-required' if the DTBook render attribute is 'required'; or 'render-optional' if the DTBook render attribute is 'optional'" </section> <section> The nordic EPUB3 profile requires that sections in the
|
<level1 class="cover"> <prodnote render="{'required' if there is a 'render-required' class, 'optional' otherwise}" imgref="{if there is one or more img longdesc referring to this section, make the prodnote refer to those imgs}" class="frontcover|rearcover|leftflap|rightflap" > </prodnote> <section> The nordic DTBook profile requires that prodnotes in the
|
DTBook: prodnote |
HTML: aside
HTML: figure
|
<aside epub:type="sidebar"></aside> <figure epub:type="sidebar"></figure> When the DTBook When the DTBook |
<sidebar render="optional"></sidebar> <sidebar render="required"></sidebar> When the DTBook attribute When the DTBook attribute
|
DTBook: sidebar |
HTML: aside
|
<aside epub:type="note"></aside> |
<note></note> The DTBook |
DTBook: note |
HTML: aside
|
<aside epub:type="annotation"></aside> |
<p class="..."></p>
|
DTBook: annotation |
HTML: aside
|
<aside epub:type="epigraph"></aside> |
<p class="..."></p>
|
DTBook: epigraph |
HTML: span
|
<span class="byline"></span> |
<span></span>
|
DTBook: byline |
HTML: span
|
<span class="dateline"></span> |
<span></span>
|
DTBook: dateline |
HTML: section
HTML: div
|
<section class="linegroup"> <h[1-6]></h[1-6]> </section> <div class="linegroup"></div> If the DTBook linegroup contains a If the DTBook linegroup does not contain
a |
<linegroup> <hd></hd> </linegroup> <linegroup></linegroup> |
DTBook: linegroup |
HTML: section
HTML: div
|
<section epub:type="z3998:poem"> <h[1-6]></h[1-6]> </section> <div epub:type="z3998:poem"></div> If the DTBook poem contains a If the DTBook poem does not contain
a |
<poem> <hd></hd> </poem> <poem></poem> |
DTBook: poem |
HTML: strong
|
<strong class="title"></strong> |
<title></title> A DTBook title is the title of a poem ( |
DTBook: title |
HTML: span
|
<span epub:type="z3998:author"></span> This is the author of a poem (DTBook |
<author></author> |
DTBook: author |
HTML: a | <a type="..." href="..." hreflang="..." rel="..." accesskey="..." tabindex="..." target="{if the DTBook 'external' attribute is 'true', then '_blank'}"> </a> |
<a type="..." href="..." hreflang="..." rel="..." accesskey="..." tabindex="..." external="{if target is '_blank' or href has a protocol (such as "http:" or "file:"), then 'true'; otherwise 'false'}"> </a> ...or... <span></span>
The HTML |
DTBook: a |
HTML: em | <em></em> |
<em></em> |
DTBook: em |
HTML: strong | <strong></strong> |
<strong></strong> |
DTBook: strong |
HTML: dfn | <dfn></dfn> |
<span class="definition"></span>
|
DTBook: dfn |
HTML: kbd | <kbd></kbd> |
<code class="keyboard"></code>
|
DTBook: kbd |
HTML: code | <code></code> |
<code></code> |
DTBook: code |
HTML: samp | <samp></samp> |
<code class=example"></code>
|
DTBook: samp |
HTML: cite | <cite></cite> |
<span class="cite"></span>
|
DTBook: cite |
HTML: abbr
|
<abbr epub:type="z3998:truncation"></abbr> |
<span class="truncation"></span>
|
DTBook: abbr |
HTML: abbr |
<abbr></abbr> <abbr epub:type="z3998:initialism"></abbr> If the DTBook element is Reading systems should spell out the characters of text
contained within elements that has a epub:type of
"z3998:initialism". However, it is unlikely that the z3998
vocabulary will get widespread support in reading systems, so
a CSS rule should be added that applies
|
<span class="acronym"></span> <!-- could be: <acronym pronounce="no"></acronym> --> <span class="initialism"></span> <!-- could be: <acronym pronounce="yes"></acronym> -->
|
DTBook: acronym |
HTML: sub | <sub></sub> |
<sub></sub> |
DTBook: sub |
HTML: sup | <sup></sup> |
<sup></sup> |
DTBook: sup |
HTML: span | <span></span> |
<span></span> |
DTBook: span |
HTML: bdo | <bdo></bdo> |
<span></span>
|
DTBook: bdo |
HTML: span
|
<span epub:type="z3998:sentence"></span> |
<span class="sentence"></span>
|
DTBook: sent |
HTML: span
|
<span epub:type="z3998:word"></span> |
<span class="word"></span>
|
DTBook: w |
HTML: span
|
<span epub:type="pagebreak" class="page-X" title="Y"/></span> <div epub:type="pagebreak" class="page-X" title="Y"></div> DTBook pagenums are converted to HTML spans or divs according to the HTML content model. |
<pagenum page="X">Y</pagenum> <pagenum page="X">Y</pagenum> When a class starting with "page-" is present, the page attribute will be set to the corresponding value. For instance, when a "page-normal" class is present, the page attribute will be set to "normal". |
DTBook: pagenum |
HTML: a
|
<a epub:type="noteref" href="#href" type="..."></a> |
<noteref idref="#href" type="..."></noteref> The DTBook |
DTBook: noteref |
HTML: a
|
<a epub:type="annoref"></a> |
<span></span>
|
DTBook: annoref |
HTML: q | <q></q> |
<span class="quote"></span>
|
DTBook: q |
HTML: img | <img src="..." alt="..." longdesc="..." height="..." width="..." id="..."/> If there is a DTBook |
<img src="..." alt="..." longdesc="..." height="..." width="..." id="..."></img> |
DTBook: img |
HTML: figure |
<figure></figure> Image series example: <figure> <figcaption><!-- caption for the image series --></figcaption> <figure> <img src="..." alt="alternative text for the first image"/> <figcaption><!-- caption for the first image --></figcaption> </figure> <figure> <img src="..." alt="alternative text for the second image"/> <figcaption><!-- caption for the second image --></figcaption> </figure> </figure> In DTBook, multiple |
<imggroup></imggroup> Image series example: <imggroup> <caption><!-- caption for the image series --></caption> <img src="..." alt="alternative text for the first image"/> <caption><!-- caption for the first image --></caption> <img src="..." alt="alternative text for the second image"/> <caption><!-- caption for the second image --></caption> </imggroup> |
DTBook: imggroup |
HTML: p |
<p></p> <hr class="emptyline"/> <p></p> <hr class="separator"/> <p></p> If the DTBook |
<p></p> <p class="precedingemptyline"></p> <p class="precedingseparator"></p> If the first preceding element to the |
DTBook: p |
HTML: hr | <hr class="emptyline|separator"/> |
The |
|
HTML: h1
HTML: p
HTML: p
|
<h1 epub:type="fulltitle"></h1> <p epub:type="z3998:covertitle"></p> <p epub:type="z3998:author"></p> doctitle, covertitle and docauthor example: <body> <header> <h1 epub:type="fulltitle"> An Invitation To Fly - Basics for the Private Pilot </h1> <!--<p epub:type="z3998:covertitle">An Invitation To Fly</p>--> <p epub:type="z3998:author">Dennis Glaeser</p> <p epub:type="z3998:author">Sanford Gum</p> <p epub:type="z3998:author">Bruce Walters</p> </header> </body> Only the fulltitle is required in the nordic EPUB3 profile. Any number of
z3998:author can occur inside the |
<doctitle></doctitle> <!-- <covertitle></covertitle> --> <docauthor></docauthor> doctitle, covertitle and docauthor example: <book> <frontmatter> <doctitle> An Invitation To Fly - Basics for the Private Pilot </doctitle> <!--<covertitle>An Invitation To Fly</covertitle>--> <docauthor>Dennis Glaeser</docauthor> <docauthor>Sanford Gum</docauthor> <docauthor>Bruce Walters</docauthor> </frontmatter> </book> The DTBook elements |
DTBook: doctitle
DTBook: docauthor DTBook: covertitle |
HTML: h1
HTML: h2 HTML: h3 HTML: h4 HTML: h5 HTML: h6 |
<h1></h1> <h2></h2> <h3></h3> <h4></h4> <h5></h5> <h6></h6> <h[1-6]></h[1-6]> |
<h1></h1> <h2></h2> <h3></h3> <h4></h4> <h5></h5> <h6></h6> <hd></hd> |
DTBook: h1
DTBook: h2 DTBook: h3 DTBook: h4 DTBook: h5 DTBook: h6 DTBook: hd |
HTML: p
|
<p epub:type="bridgehead"></p> |
<p class="bridgehead"></p>
|
DTBook: bridgehead |
HTML: blockquote | <blockquote cite="..."></blockquote> |
<blockquote cite="..."></blockquote> |
DTBook: blockquote |
HTML: dl |
<dl></dl> In DTBook, pagenums are allowed to me mixed between the
|
<dl></dl> |
DTBook: dl |
HTML: dt | <dt></dt> |
<dt></dt> |
DTBook: dt |
HTML: dd | <dd></dd> |
<dd></dd> |
DTBook: dd |
HTML: ol
HTML: ul |
<ol start="..." type="ENUM"></ol> <ul></ul> If the DTBook list contains a In DTBook, pagenums are allowed to me mixed between the
The DTBook The DTBook All DTBook lists conforming to the nordic DTBook profile must
be preformatted. Preformatted DTBook lists will be assigned the
class "list-preformatted" in HTML. CSS should be applied that
maps the list-preformatted class to the CSS rule
|
<list start="..." type="pl" enum="ENUM" depth="..."></list> <list type="pl" depth="..."></list> Note that the In the nordic DTBook profile, only preformatted lists are allowed. Disregarding the nordic DTBook profile, ordered lists should map to the DTBook list type "ol" and unordered lists should map to the DTBook list type "ul". |
DTBook: list |
HTML: li | <li>...</li> |
<li>• ...</li> In the nordic DTBook profile, only preformatted lists are allowed. As a consequence, the DTBook version is prepended with the string "• ". |
DTBook: li |
HTML: span
|
<span class="lic"></span> |
<lic></lic> |
DTBook: lic |
HTML: table | <table border="..." style="..."></table> The DTBook <table> <caption> <p class="table-summary"><!-- summary here --></p> </caption> </table> The DTBook attribute The DTBook The DTBook
The DTBook In DTBook, pagenums are allowed to me mixed between the
table rows ( |
<table summary="..." width="..." border="..." frame="..." rules="..." cellspacing="..." cellpadding="..."></table> The DTBook table attributes The content of the DTBook |
DTBook: table |
HTML: caption
Where the parent element is a |
<caption></caption> |
<caption></caption> |
DTBook: caption |
HTML: figcaption | <figcaption></figcaption> |
<caption></caption> |
DTBook: caption |
HTML: thead |
<thead></thead> The DTBook The DTBook The DTBook |
<thead></thead> The DTBook |
DTBook: thead |
HTML: tfoot |
<tfoot></tfoot> The DTBook attributes |
<tfoot></tfoot> The DTBook |
DTBook: tfoot |
HTML: tbody |
<tbody></tbody> DTBook table rows are wrapped in HTML The DTBook attributes |
<tbody></tbody> The DTBook |
DTBook: tbody |
HTML: colgroup |
<colgroup></colgroup> DTBook The DTBook attributes |
The DTBook |
DTBook: colgroup |
HTML: col |
<col/> The DTBook attributes |
The DTBook |
DTBook: col |
HTML: tr |
<tr></tr> The DTBook attributes |
<tr></tr> The DTBook |
DTBook: tr |
HTML: th
HTML: td |
<th headers="..." scope="..." rowspan="..." colspan="..."></th> <td headers="..." scope="..." rowspan="..." colspan="..."></td> The DTBook attributes The DTBook attributes |
<th headers="..." scope="..." rowspan="..." colspan="..." abbr="..." axis="..."></th> <td headers="..." scope="..." rowspan="..." colspan="..." abbr="..." axis="..."></td> The DTBook |
DTBook: th
DTBook: td |