-
Notifications
You must be signed in to change notification settings - Fork 1
A quick description of content conversion
The conversion to XML works by inferring the nature of a text block from the style that has been used to format it. Styles are recorded in the input XHTML as follows:
<span class="italic">Some italicised text</span>
<p class="quote-first-para">A blockquote</p>
These classes are then used to build the XML elements:
<hi rendition="simple:italic">Some italicised text</hi>
<quote>A blockquote</quote>
Note that two or more styles may be equivalent in terms of layout specifications (font face, font size, spacing, etc.) but record very different textual functions (and therefore be converted to very different XML elements):
<p class="signature"> => <signed>
<p class="short-ref"> => <label type="short-reference">
In many more instances, however, a formatting difference that is relevant when a text is prepared for a print or electronic display ceases to be relevant in the XML:
<p class="first-para"> => <p>
<p class="other-para"> => <p>
Even though formatting information has been programmatically discarded to make room for a functional view of the encoded text some particularly important presentational aspects of the XHTML have been retained in the XML. Very complex bits of poetry or drama are sometimes formatted using invisible tables –- when and only when maintaining a specific position or alignment is deemed central to the understanding of the text itself. These spurious tables are also retained in the XML on the assumption that discarding them would cause a loss of meaning.
Headings are used to infer the content structure thanks to the <xsl:for-each-group> instruction, which is new to XSLT 2.0. The group-starting-with method makes the element hierarchy explicit by selecting all sibling elements that occur between two specific headings and grouping them within a parent <div> element. In the XML, each heading therefore becomes the starting point of a text division <div> whose type (“chapter”, “section-lev1”, “section-lev2”, etc.) is defined by the style that was applied to the heading in the XHTML; each lower-level division is of course nested within a higher-level one. An exception is represented by book parts, whose titles are formatted using the 'heading0' paragraph style. These have not been treated as structural divisions but rather as labels, allowing for the presence of book parts to be recorded without the need to aggregate different sections within larger units.
In a few instances the flat structure of the input XHTML files has been retained in the output. Captions, for example, are not nested within the <figure> element they refer to. The relationship is made explicit through the use of attributes instead: an automatically generated xml:id is added to the <figure> and a corresp attribute is included in the <p> element that encloses the caption. Similarly, two paragraphs belonging to the same blockquote are encoded as <quote> and <quote type=“cont”> respectively rather than being grouped within the same element.