Chapter 8. How it works
- The Processor is the main component of XMLmind Ebook Compiler. It
processes an ebook specification referencing a number of valid XHTML5
pages. It generates processed valid XHTML5 pages and generally also, a
subdirectory (called "
_res/
" by default) containing all the resources referenced by the processed pages.Whatever the file layout of the input HTML pages and their resources, all the files and directories are always created in a single output directory, which makes this output directory self-contained.
In addition to the processed pages, the Processor automatically creates an HTML page (called "
_toc_frame.html
" by default) containing a table of contents and the manifest of all the resources found in the resource directory (in the form of<link href="XXX" rel="resource" type="YYY"/>
elements).The Processor also automatically creates an HTML page (called "
_frameset.html
" by default) containing aframeset
. The only purpose of thisframeset
is to be able to quickly navigate the output of the Processor when testing and debugging. - Generating a single HTML page out of an ebook
specification does not involve any further processing steps. The
Processor is simply instructed to generate a single page and files
"
_toc_frame.html
" and "_frameset.html
" are discarded. - Generating an EPUB file requires transforming
"
_toc_frame.html
" by the means of thexsl/epub/epub.xsl
stylesheet and then archiving[1] the contents of the output directory. - Generating a Web Help requires transforming
"
_toc_frame.html
" by the means of thexsl/webhelp/webhelp.xsl
stylesheet and then processing the contents of the output directory using XMLmind Web Help Compiler. - Generating PDF, DOCX, ODT, etc, requires first
generating an intermediate format called XSL-FO. This is
done by the means of the
xsl/fo/fo.xsl
stylesheet. After that, it's up to an XSL-FO processor — Apache FOP, RenderX XEP or Antenna House Formatter for the PostScript and PDF formats, XMLmind XSL-FO Converter for the RTF, WML, DOCX and ODT formats— to create the output file. - The CSS styles specified in the ebook specification
and in the source HTML pages are also used when generating output
formats based on XSL-FO. However for this to work, these CSS styles need
to be translated to directly usable XSL-FO properties (see
apply-css-styles
) and stored in processing-instructions (<?css-styles?>
) prior to be transformed by thexsl/fo/fo.xsl
stylesheet. This preparatory step is implemented by the "CSS to XSL-FO properties" component depicted in the above figure.