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.

Resources

Mapping table

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

name="dc:Title"

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:

  • Any dc:* metadata will be de-capitalized in HTML. For instance, dc:Language becomes dc:language.
  • Any track:* metadata will also be be de-capitalized in HTML, and the prefix will be changed to nordic. For instance, track:SuppliedDate becomes nordic:suppliedDate.
  • The DTBook dc:Title meta element becomes a HTML <title> element (see HTML title element).
<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:

  • Any dc:* metadata will be capitalized in DTBook. For instance, dc:language becomes dc:Language.
  • Any nordic:* metadata will also be be capitalized in DTBook, and the prefix will be changed to track. For instance, nordic:suppliedDate becomes track:SuppliedDate.
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 <section> corresponding to a DTBook <level1> are assigned the epub:type corresponding to their location in the DTBook.

The exception to this rule is DTBook <level1> elements which has the class "cover" (or "jacketcopy"). This will be mapped to an HTML <section> element with the epub:type "cover".

<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 <section> elements with the epub:type "cover" or "frontmatter" are converted to DTBook <level1> elements and wrapped inside the DTBook <frontmatter> element. When the epub:type is "cover", a "cover" class is added to the level1.

All top-level HTML <section> elements with either the epub:type "bodymatter", or which does not have either the epub:type "frontmatter" or "backmatter" are converted to DTBook <level1> elements and wrapped inside the DTBook <bodymatter> element.

All top-level HTML <section> elements with the epub:type "backmatter" are converted to DTBook <level1> elements and wrapped inside the DTBook <rearmatter> element.

DTBook: book

The DTBook <frontmatter> element is replaced with its contents, and all its DTBook <level1> children are converted to HTML <section> elements and assigned the epub:type "frontmatter".

<frontmatter></frontmatter>
DTBook: frontmatter

The DTBook <bodymatter> element is replaced with its contents, and all its DTBook <level1> children are converted to HTML <section> elements and assigned the epub:type "bodymatter".

<bodymatter></bodymatter>
DTBook: bodymatter

The DTBook <rearmatter> element is replaced with its contents, and all its DTBook <level1> children are converted to HTML <section> elements and assigned the epub:type "backmatter".

<rearmatter></rearmatter>
DTBook: rearmatter
HTML: section
HTML: article
<section epub:type="DIVISION PARTITION"></section>
<article></article>

Top-level HTML <section> elements are wrapped into the DTBook <frontmatter>, <bodymatter> and <rearmatter> elements according to the four document partitions (see HTML body element / DTBook book element).

The top-level HTML <section> elements must state one of the four document partitions:

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

class="line"

<p class="line"></p>
<line></line>
DTBook: line
HTML: span

class="linenum"

<span class="linenum"></span>
<linenum></linenum>
DTBook: linenum
HTML: address
<address></address>
<p class="address"></p>

<address> is not allowed in the nordic DTBook profile; replacing with <p>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <address>

DTBook: address
HTML: div
<div></div>
<div></div>
DTBook: div
HTML: aside

epub:type="z3998:production"

<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 epub:type="cover"

<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 epub:type="cover" division declares one of the classes: "frontcover", "rearcover", "leftflap" or "rightflap".

<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 class="cover" division declares one of the classes: "frontcover", "rearcover", "leftflap" or "rightflap".

DTBook: prodnote
HTML: aside

epub:type="sidebar"


HTML: figure

epub:type="sidebar"

<aside epub:type="sidebar"></aside>
<figure epub:type="sidebar"></figure>

When the DTBook render attribute is "optional", or if the render attribute is missing, the sidebar is mapped to a HTML <aside> element.

When the DTBook render attribute is "required", the sidebar is mapped to a HTML <figure> element.

<sidebar render="optional"></sidebar>
<sidebar render="required"></sidebar>

When the DTBook attribute render is "optional", or if the DTBook render attribute is missing, the sidebar is mapped to a HTML <aside epub:type="sidebar">.

When the DTBook attribute render is "required", the sidebar is mapped to a HTML <figure epub:type="sidebar">.

DTBook: sidebar
HTML: aside

epub:type="note"

<aside epub:type="note"></aside>
<note></note>

The DTBook class attribute is not allowed in the nordic DTBook profile, so it is dropped during conversion from HTML.

DTBook: note
HTML: aside

epub:type="annotation"

<aside epub:type="annotation"></aside>
<p class="..."></p>

<annotation> is not allowed in the nordic DTBook profile; replacing with <p>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <annotation>

DTBook: annotation
HTML: aside

epub:type="epigraph"

<aside epub:type="epigraph"></aside>
<p class="..."></p>

<epigraph> is not allowed in the nordic DTBook profile; replacing with <p>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <epigraph>

DTBook: epigraph
HTML: span

class="byline"

<span class="byline"></span>
<span></span>

<byline> is not allowed in the nordic DTBook profile; replacing with <span>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <byline>

DTBook: byline
HTML: span

class="dateline"

<span class="dateline"></span>
<span></span>

<dateline> is not allowed in the nordic DTBook profile; replacing with <span>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <dateline>

DTBook: dateline
HTML: section

class="linegroup"


HTML: div

class="linegroup"

<section class="linegroup">
   <h[1-6]></h[1-6]>
</section>
<div class="linegroup"></div>

If the DTBook linegroup contains a <hd>, then it can be mapped to a HTML <section>. DTBook <hd> elements is not allowed in the nordic profile though, so this will never happen.

If the DTBook linegroup does not contain a <hd>, then it is mapped to a HTML <div>.

<linegroup>
   <hd></hd>
</linegroup>
<linegroup></linegroup>
DTBook: linegroup
HTML: section

epub:type="z3998:poem"


HTML: div

epub:type="z3998:poem"

<section epub:type="z3998:poem">
   <h[1-6]></h[1-6]>
</section>
<div epub:type="z3998:poem"></div>

If the DTBook poem contains a <hd>, then it can be mapped to a HTML <section>. DTBook <hd> elements is not allowed in the nordic profile though, so this will never happen.

If the DTBook poem does not contain a <hd>, then it is mapped to a HTML <div>.

<poem>
   <hd></hd>
</poem>
<poem></poem>
DTBook: poem
HTML: strong

class="title"

<strong class="title"></strong>
<title></title>

A DTBook title is the title of a poem (<poem>) or citation (<cite>). It does not correspond to the identically named HTML <title> element.

DTBook: title
HTML: span

epub:type="z3998:author"

<span epub:type="z3998:author"></span>

This is the author of a poem (DTBook <poem>) or citation (DTBook <cite>). If an element with the epub:type "z3998:author" occurs within the top-level HTML <header> element, then it has different semantics (i.e. it would map to a DTBook <docauthor> element).

<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>

<a> is normally not allowed in the nordic DTBook profile; by default these are replaced with <span>. However, a parameter in the converter enables links, which lets the links be carried through to the DTBook.

The HTML download and media attributes are dropped since they have no equivalent in DTBook.

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>

<dfn> is not allowed in the nordic DTBook profile; replacing with <span>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <dfn>

DTBook: dfn
HTML: kbd
<kbd></kbd>
<code class="keyboard"></code>

<kbd> is not allowed in the nordic DTBook profile; replacing with <code>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <kbd>

DTBook: kbd
HTML: code
<code></code>
<code></code>
DTBook: code
HTML: samp
<samp></samp>
<code class=example"></code>

<samp> is not allowed in the nordic DTBook profile; replacing with <code>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <samp>

DTBook: samp
HTML: cite
<cite></cite>
<span class="cite"></span>

<cite> is not allowed in the nordic DTBook profile; replacing with <span>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <cite>

DTBook: cite
HTML: abbr

epub:type="z3998:truncation"

<abbr epub:type="z3998:truncation"></abbr>
<span class="truncation"></span>

<abbr> is not allowed in the nordic DTBook profile; replacing with <span>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <abbr>

DTBook: abbr
HTML: abbr
<abbr></abbr>

<abbr epub:type="z3998:initialism"></abbr>

If the DTBook element is <acronym> and its attribute pronounce is "yes", or if the DTBook element is <span> and has a "initialism" class, then a HTML epub:type of "z3998:initialism" is added.

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 -epub-speak-as: spell-out; to all elements with epub:type="z3998:initialism". It could've been performed in the conversion by adding it to the style attribute, but it is better to do it in a global CSS rule.

<span class="acronym"></span>
<!-- could be: <acronym pronounce="no"></acronym> -->
<span class="initialism"></span>
<!-- could be: <acronym pronounce="yes"></acronym> -->

<acronym> is not allowed in the nordic DTBook profile; replacing with <span>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <acronym>, and the pronounce attribute would be set to "yes" if a epub:type of "z3998:initialism" were present, or false otherwise.

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>

<bdo> is not allowed in the nordic DTBook profile; replacing with <span>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <bdo>

DTBook: bdo
HTML: span

epub:type="z3998:sentence"

<span epub:type="z3998:sentence"></span>
<span class="sentence"></span>

<sent> is not allowed in the nordic DTBook profile; replacing with <span>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <sent>

DTBook: sent
HTML: span

epub:type="z3998:word"

<span epub:type="z3998:word"></span>
<span class="word"></span>

<w> is not allowed in the nordic DTBook profile; replacing with <span>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <w>

DTBook: w
HTML: span

epub:type="pagebreak"

HTML: div

epub:type="pagebreak"

<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

epub:type="noteref"

<a epub:type="noteref" href="#href" type="..."></a>
<noteref idref="#href" type="..."></noteref>

The DTBook class attribute is not allowed in the nordic DTBook profile and is dropped.

DTBook: noteref
HTML: a

epub:type="annoref"

<a epub:type="annoref"></a>
<span></span>

<annoref> is not allowed in the nordic DTBook profile; replacing with <span>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <annoref> in a similar fashion to how <a epub:type="noteref"> is converted.

DTBook: annoref
HTML: q
<q></q>
<span class="quote"></span>

<q> is not allowed in the nordic DTBook profile; replacing with <span>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <q>

DTBook: q
HTML: img
<img src="..." alt="..." longdesc="..."
     height="..." width="..." id="..."/>

If there is a DTBook <prodnote> or <caption> referencing this <img> using the imgref attribute, then a HTML longdesc attribute is added to this <img> which refers to the HTML element corresponding to the DTBook <prodnote> or <caption>. If the image has multiple prodnotes or captions, only the first one (in document order) will be referenced, since the HTML longdesc attribute can only contain a single reference.

<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 <caption> elements are allowed which allows for assigning individual captions to individual images inside the same imggroup. In HTML, only one <figcaption> is allowed inside each <figure>. To solve this, each image in HTML (unless the image is purely decorative, signalled by an empty alt attribute), must be wrapped in a separate <figure>.

<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> element has a precedingemptyline or precedingseparator class, then a <hr> is inserted before the HTML <p> with either a emptyline or separator respectively.

<p></p>

<p class="precedingemptyline"></p>

<p class="precedingseparator"></p>

If the first preceding element to the <p> in the HTML is a <hr class="emptyline"/> or <hr class="separator"/>, then the <hr class="..."/> is removed and a precedingemptyline or precedingseparator class is added to the <p>.

DTBook: p
HTML: hr
<hr class="emptyline|separator"/>

The <hr/> element is deleted and added as a precedingemptyline or precedingseparator class to the following <p> element (see description of <p>).

HTML: h1

epub:type="fulltitle"

and

The parent element is a 'header' which in turn has a 'body' element as parent.


HTML: p

epub:type="z3998:covertitle"

and

The parent element is a 'header' which in turn has a 'body' element as parent.


HTML: p

epub:type="z3998:author"

and

The parent element is a 'header' which in turn has a 'body' element as parent.

<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 <header>. <covertitle> is disallowed in the nordic DTBook profile and is removed if present in the HTML, but could potentially be converted as indicated in the example.

<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 <doctitle>, <docauthor> and <covertitle> is mapped to the HTML elements <h1 epub:type="fulltitle">, <p epub:type="z3998:author"> and <p epub:type="z3998:covertitle"> respectively, contained within the first child element of the HTML element <body>, which must be a <header>. <covertitle> is not supposed to occur as it is disallowed in the nordic DTBook profile.

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

epub:type="bridgehead"

<p epub:type="bridgehead"></p>
<p class="bridgehead"></p>

<bridgehead> is not allowed in the nordic DTBook profile; replacing with <p>. Disregarding the nordic DTBook profile, this could be converted to a DTBook <bridgehead>

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 <dt> and <dd> elements. When converting to HTML, any pagenums at the beginning of the <dl> is moved to before the list. Any pagenums at the end of the <dl> is moved to after the list. Any pagenums in between the list elements are moved into the end of the first preceding element.

<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 <hd>, then the list will be wrapped (along with the headline) in a HTML <section>. However, <hd> is not allowed in the nordic DTBook profile, so this will never happen.

In DTBook, pagenums are allowed to me mixed between the <li> elements. When converting to HTML, any pagenums at the beginning of the DTBook <list> is moved to before the list. Any pagenums at the end of the <list> is moved to after the list. Any pagenums in between the list elements are moved into the end of the first preceding list item element.

The DTBook depth attribute is dropped since it does not have a HTML equivalent, and because it does not add any information to the document anyway (the depth is implicit).

The DTBook enum attribute is renamed to type in HTML. The DTBook type attribute determines whether the list is converted to a HTML <ol> or <ul>; the DTBook and HTML type attributes are not equivalent, despite their name.

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-style-type: none; so that bullets and numbering are not displayed. This rule is included in the default CSS bundled with the nordic EPUB3/DTBook migrator.

<list start="..." type="pl" enum="ENUM" depth="..."></list>
<list type="pl" depth="..."></list>

Note that the type attribute in HTML and the type attribute in DTBook is not the same. The enum attribute in DTBook is the same as the type attribute in HTML, while the type attribute in DTBook signals the type of list (ordered / unordered / preformatted).

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

class="lic"

<span class="lic"></span>
<lic></lic>
DTBook: lic
HTML: table
<table border="..." style="..."></table>

The DTBook summary attribute does not have a HTML equivalent, so it is mapped to a HTML <p> element in the table caption like this:

<table>
   <caption>
      <p class="table-summary"><!-- summary here --></p>
   </caption>
</table>

The DTBook attribute cellpadding is added to the HTML style attribute of descendant <th> and <td> elements using the CSS padding property.

The DTBook width attribute is converted to the HTML style attribute using the CSS property width.

The DTBook cellspacing attribute is converted to the HTML style attribute using the CSS properties border-collapse and border-spacing as follows:

  • When cellspacing is empty or 0; border-collapse: collapse; border-spacing: 0;
  • Otherwise; border-collapse: separate; border-spacing: {CELLSPACING}px;

The DTBook frame and rules attributes are dropped, since their equivalents are deprecated in HTML5.

In DTBook, pagenums are allowed to me mixed between the table rows (<tr>). When converting to HTML, any pagenums at the beginning of the <table> is moved to before the table. Any pagenums at the end of the <table> is moved to after the table. Any pagenums in between the table rows are moved into the end of the first preceding table row element or table caption element.

<table summary="..." width="..." border="..." frame="..."
       rules="..." cellspacing="..." cellpadding="..."></table>

The DTBook table attributes cellspacing, cellpadding and width could potentially be inferred from the CSS in the HTML, but it's probably not worth it so they are ignored for now.

The content of the DTBook summary attribute is retrieved from the HTML <p class="table-summary"> element at the beginning of the table <caption> (if present).

DTBook: table
HTML: caption

Where the parent element is a <table>

<caption></caption>
<caption></caption>
DTBook: caption
HTML: figcaption
<figcaption></figcaption>
<caption></caption>
DTBook: caption
HTML: thead
<thead></thead>

The DTBook valign attribute is converted to the HTML style attribute using the CSS property vertical-align.

The DTBook align attribute is converted to the HTML style attribute using the CSS property align. The CSS padding property could potentially be used on the <tr> elements to match the layout implied when the align attribute is "char", (based also on the DTBook char and charoff attributes) but this is not implemented and is probably not necessary.

The DTBook char and charoff attributes are dropped since their equivalents in HTML are deprecated in HTML5.

<thead></thead>

The DTBook align and valign attributes could potentially be inferred from the HTML CSS here, but it's probably not worth it so they are ignored for now.

DTBook: thead
HTML: tfoot
<tfoot></tfoot>

The DTBook attributesvalign, align, char and charoff are treated the same as for <thead>.

<tfoot></tfoot>

The DTBook cellhalign and cellvalign attributes could potentially be inferred from the HTML CSS here, but it's probably not worth it so they are ignored for now.

DTBook: tfoot
HTML: tbody
<tbody></tbody>

DTBook table rows are wrapped in HTML <tbody> even if no DTBook <tbody> is present. This is how HTML is parsed into the DOM anyway, so using <tbody> in the markup makes things simpler.

The DTBook attributesvalign, align, char and charoff are treated the same as for <thead>.

<tbody></tbody>

The DTBook cellhalign and cellvalign attributes could potentially be inferred from the HTML CSS here, but it's probably not worth it so they are ignored for now.

DTBook: tbody
HTML: colgroup
<colgroup></colgroup>

DTBook <col> elements will be wrapped in HTML <colgroup> even if no DTBook <tbody> is present.

The DTBook attributesvalign, align, char and charoff are treated the same as for <thead>.

<colgroup> is not allowed in the nordic DTBook profile and is deleted. Disregarding the nordic DTBook profile, this could be converted to a DTBook <colgroup>, and the span attribute could be copied over directly.

The DTBook width, cellhalign and cellvalign attributes could potentially be inferred from the HTML CSS here, but it's probably not worth it so they are ignored for now.

DTBook: colgroup
HTML: col
<col/>

The DTBook attributesvalign, align, char and charoff are treated the same as for <thead>.

<col> is not allowed in the nordic DTBook profile and is deleted. Disregarding the nordic DTBook profile, this could be converted to a DTBook <col>, and the span attribute could be copied over directly.

The DTBook width, cellhalign and cellvalign attributes could potentially be inferred from the HTML CSS here, but it's probably not worth it so they are ignored for now.

DTBook: col
HTML: tr
<tr></tr>

The DTBook attributesvalign, align, char and charoff are treated the same as for <thead>.

<tr></tr>

The DTBook width, cellhalign and cellvalign attributes could potentially be inferred from the HTML CSS here, but it's probably not worth it so they are ignored for now.

DTBook: tr
HTML: th
HTML: td
<th headers="..." scope="..."
    rowspan="..." colspan="..."></th>

<td headers="..." scope="..."
    rowspan="..." colspan="..."></td>

The DTBook attributesvalign, align, char and charoff are treated the same as for <thead>.

The DTBook attributes abbr and axis are ignored as they have no good equivalent in HTML.

<th headers="..." scope="..."
    rowspan="..." colspan="..."
    abbr="..." axis="..."></th>
<td headers="..." scope="..."
    rowspan="..." colspan="..."
    abbr="..." axis="..."></td>

The DTBook cellhalign and cellvalign attributes could potentially be inferred from the HTML CSS here, but it's probably not worth it so they are ignored for now.

DTBook: th
DTBook: td