********************************************************************** BookX --> BookXHTML (conformant to XHTML 1.1) Procedural Description 05-Mar-2007 version, supercedes 04-Mar-2007. For reference, the latest draft BookX DTD is found at: http://www.bookx.org/dtd/bookx10.dtd I. Assumptions and global requirements: --------------------------------------- 1) All BookX documents will be valid to the BookX DTD and meet ALL other requirements listed in the BookX DTD, including those which cannot be enforced by validation to the DTD. Thus, no need to worry about pre-testing for malformed BookX documents before transforming. A BookX conformance checker is being planned. 2) One requirement is that all BookX documents must be UTF-8 or UTF-16 encoded, and the XHTML 1.1 transform must also be the same. 3) The output XHTML 1.1 document must follow the following "top-level template": ======================================================================
remain "as is" (no mapping).
...
--> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
... --> ...
-->
... --> ...
... --> ...
... --> ...
... --> ...
...
--> ...
(note, BookX should not map to XHTML since there are
problems with that element because of quotation marks plus the
default for XHTML is not italic. In BookX, is for
quotations *intended* to be highlighted with the default being
italic.)
... --> ...
... --> ...
... --> ...
**********************************************************************
V. Cover Image
---------------
When is present in BookX, the information is to be
transferred to the
section as shown in the XHTML 1.1 template and as described below.
The BookX:
...
(note that 'id' and 'loititle' are required; ignore 'loiitem' if
present.)
maps to the XHTML 1.1:
...
For the contained , that maps to XHTML
, with the
'source' attribute mapping to the
'src' attribute.
In addition, map the value of 'loititle' in the parent
to both the 'alt' and 'title' attributes of XHTML
. (If 'pubcomment' is present on , ignore that.)
Also, if 'href' is present in , that means the image is to be
hypertext linked. In this case, wrap
within
....
BookX Example:
(Again note that 'id' is always required on )
The above maps to the XHTML 1.1 (various white space has been added to
improve readability):
**********************************************************************
VI. Title Page (or frontispiece)
-------------------------------
This section of the XHTML 1.1 document is entirely reconstructed from
the BookX metadata. The parts are to be ordered as follows:
a. Book Title(s) (required, from )
b. Creator(s) (required, from )
c. Publisher/Imprint (both optional, from and )
d. Copyright (optional, from )
e. Identifer(s) (optional, from )
Note that for this section, any inline elements in any of the BookX
metadata elements must be preserved, and mapped to their XHTML
equivalents as outlined elsewhere in this document.
a. For Book Title(s), map each ... to
...
and wrap all of them (one or more)
within a .... For example, if
there are two :
First Line of Book Title
Second Line of Book Title
b. For Creator(s), map each ... to
...
and wrap all of them (one or more)
within a ....
In addition, for each creator transfer the value of the 'role'
attribute (a three character MARC Relator code) into the 'class'
attribute. For example, if there are two , one of which
is a "aut" (for author) and another is "ill" (for illustrator):
John Doe
Jane Doe
(Ignore 'file-as' attribute if present in .)
c. For and , if either one or both are present,
map their contents to (as appropriate):
Publisher Name
Imprint Name
d. For ... , map contents to:
[copyright contents]
e. For , the mapping is somewhat complicated.
Each BookX is mapped to ,
and all of them are wrapped in .
Order of multiple identifiers, if present, is significant and must
be preserved. The content of BookX , which may only be
character data (i.e., it cannot contain any inline elements), is to
be modified using the value to the required 'ver' attribute, best
explained by the following BookX example:
urn:uuid:6a2014b0-87a2-11da-a72b-0800200c9a66
urn:isbn:90-70002-34-5
maps to:
urn:uuid:6a2014b0-87a2-11da-a72b-0800200c9a66 (version 1)
urn:isbn:90-70002-34-5 (version 2)
**********************************************************************
VII. Table of Contents
----------------------
If there are any valid entries for the Table of Contents, as will be
explained here, then include this section in the XHTML 1.1 document.
Otherwise it can be left out or represented by the empty
.
[NEED TO ADD THIS]
**********************************************************************
VIII. List of Illustrations
---------------------------
If there are any valid entries for the List of Illustrations, as will
be explained here, then include this section in the XHTML 1.1
document. Otherwise it can be left out or represented by the empty
.
[NEED TO ADD THIS]
**********************************************************************
IX. Frontmatter portion
-----------------------
In BookX, the optional section content maps to the
XHTML 1.1 ... section (see template).
The "frontmatter" section is to include the and
content when either or both are present (when both
are present, they appear in that order and will be mapped in that
order.)
Here are these element mappings:
... --> ...
... --> ...
Ignore the value of 'tocitem' if present.
For either and , if 'toctitle' appears,
use its value for the XHTML 1.1 'title' attribute, which overrides the
value in the BookX 'pubcomment' attribute if that is also present.
**********************************************************************
X. endmatter portion
--------------------
In BookX, the optional section maps to the XHTML 1.1
... section (see template).
The endmatter section is to include the and content
when either or both are present (when both are present, they appear in
that order and will be mapped to XHTML 1.1 in that order.
Here are these element mappings:
... --> ... and
... --> ...
Ignore 'tocitem' if present. In addition, if 'toctitle' is present,
map its value to 'title' instead of the value in 'pubcomment' if
that is also present.
Example:
...
maps to:
...
**********************************************************************
XI. Some more complicated mappings
----------------------------------
1)
======
BookX
straightforwardly maps to XHTML 1.1
.
However, if Bookx
includes the 'continuation' attribute, do the
following:
a) If the value of 'continuation' is "no", ignore this attribute,
there will be no transfer of the information to XHTML 1.1
.
b) If the value of 'continuation' is "yes", then add the 'class'
attribute to XHTML
and set its value to "continuation".
2)
=========
When the attribute 'ordered' is present and its value is "yes", then
...
--> ...
Otherwise:
...
--> ...
3)
============
... maps to:
...
In addition, if the 'vhireq' attribute is present in , all
the space-separated NMTOKEN values in 'vhireq' are placed into the
XHTML 'class' attribute along with the value for the 'type' attribute.
For example:
...
maps to XHTML 1.1:
...
4) and
============================
(This is the most complex transformation in BookX.)
and are for embedding an image into a BookX
document. In addition, may be present in .
The top-level mapping is:
(note that 'id' and 'loititle' are required.)
maps to
...
In addition, place the value of the 'position' attribute (whether
specified or its implied default value of 'inflow') into the class
attribute, e.g.,
...
Finally, map the value of the required 'loititle' attribute to the
'alt' and 'title' attributes for the associated XHTML 1.1
element (see below). Ignore 'loiitem' if present.
(For what to do with the 'assocwith' attribute, if present, refer to
the section discussing hierarchical structural levels. Otherwise this
value is not transferred anywhere to the XHTML 1.1
division.)
For , that maps to XHTML
, with the 'source' attribute
mapping to the
'src' attribute. As noted above, map the
'loititle' value to the 'alt' and 'title' attributes (for 'title',
this would override any given value for 'pubcomment' if present.)
If 'href' is present in , that means the image is to be
hypertext linked. In this case, wrap
with
... element.
BookX Example (including ):
------------------------------------
Headquarters of the Acme Corporation
(Note that 'id' is always required on )
The above maps to the XHTML 1.1:
5) BookX
===============
... --> ...
In addition, if the attribute value 'hiddenlink' is present and if its
value is "yes", then add the 'class' value of "hidden" to .
For example.
...
maps to
...
6)
==============
... maps to ...
where N in "indentN" is an integer from 0 to 6:
a) If the 'indent' attribute is not present on , set N="0"
b) If the 'indent' attribute is present, set its value, which is a
single digit integer of 0 to 6, to the value of "N".
For example:
... maps to
...
and
... maps to
...
7) and
============================
... maps to
where * is one of three tokens:
"lines-left"
"lines-center"
"lines-right"
Which token to use for * is determinable by:
a) If the 'justify' attribute is not present on , use
"lines-center"
b) If the 'justify' attribute is present on , use:
justify="left" --> "lines-left"
justify="center" --> "lines-center"
justify="right" --> "lines-right"
Examples:
... -->
... -->
For
... maps to