This page details the cleaning process applied by the DTBook Cleaner script for each set of routines provided.
The “repair” set of routines repairs some structural errors when encountered :
levelx if it has descendant headings of x-1
(this simplifies later steps). level1/level2/level1
hx into a p with @class="hx" if parent isn’t levelxhx in inline context.
Support for this could be added.p
p-tag if hx is the last elementli when the parent of the list is another list@type if missing (default value is "pl")@depth attribute@enum attribute if the list is not ordered@start attribute if the list is not orderedidref must be present on noteref and annoref. Add idref if missing or
change if empty.idref must include a fragment identifier. Add a hash mark
in the beginning of all idref attributes that don’t contain a hash mark.p except when
hx or no preceding element and parent is a levelp
em, strong, sub, sup
@page="normal" but the contents of the element doesn’t match “normal”
content, the @page attribute is changed to:
@page="front" if the contents is roman numerals and the pagenum
element is located in the frontmatter of the book@page="special" otherwise@page="front" but the contents of the element doesn’t match “front”
content (neither roman nor arabic numerals), the @page attribute is
changed to “special”dtb:uid (if missing) from dc:Identifierdc:Title (if missing) from doctitledtb:uid if missing (or if it has empty contents)The “tidy” set of routines removes empty elements and reorganize misplaced elements:
p except when
hx or no preceding element and parent is a levelp
em, strong, sub, sup
pagenum inside h[x] before h[x]
pagenum inside a word after the word@page attribute to make it match the contents of the pagenum
element.
@page="front" but the contents of the element is an arabic number,
the @page attribute is changed to "normal"@page="front", but
are not considered standard practice by many)@page="special" but the element has no content, adds a dummy content
(“page break”).p or li around pagenum (except p in td)docauthor and doctitle if a frontmatter exists without those
elementsthe “narrator” set of routines tries to optimize the dtbook for text-to-speech processes:
dc:Language, dc:Date and dc:Publisher to dtbook, if not present in
input, or given but with null/whitespace only content valuesdc:description and dc:subject if not valueddc:Format (will be added by the fileset generator)h[x+1] in level[x+1] unless h[x] in li[x] is present
level1
list or dl inside p :
dc:Title meta element and the doctitle frontmatter element, if
not present in input, or given but with null/whitespace only content values.
dc:Title metadata if it is presentdoctitle element in the frontmatter