Chapter 8. How it works

Figure 8-1. XMLmind Ebook Compiler components
XMLmind Ebook Compiler components The main component of XMLmind Ebook CompilerSingle HTML page outputEPUB ouputWeb Help ouputXSL-FO based outputCSS styles to XSL-FO properties
  1. 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 a frameset. The only purpose of this frameset is to be able to quickly navigate the output of the Processor when testing and debugging.

  2. 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.
  3. Generating an EPUB file requires transforming "_toc_frame.html" by the means of the xsl/epub/epub.xsl stylesheet and then archiving[1] the contents of the output directory.
  4. Generating a Web Help requires transforming "_toc_frame.html" by the means of the xsl/webhelp/webhelp.xsl stylesheet and then processing the contents of the output directory using XMLmind Web Help Compiler.
  5. 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.
  6. 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 the xsl/fo/fo.xsl stylesheet. This preparatory step is implemented by the "CSS to XSL-FO properties" component depicted in the above figure.

[1] An EPUB is a zip archive.