XBook - Generation Guide
|
Author: Just van den Broecke Date: 24.jan.2002 |
This document describes the tools and stylesheets used in the generation process. |
[WORK IN PROGRESS]
This script is used to generate the entire site from a book.xml file according to book.dtd.
xbook.bat|sh [-lite] <book file> <destination directory>
The optional -lite option can be used to generate only lightweight HTML menus (like in this documentation) i.s.o. DHTML menus. If not specified both a lightweight and DHTML menu is generated. The lightweight index file is called index-lite.html.
See the test/book example directory.
This script is used to generate HTML from an XML document written according to one of the standard document DTDs like doc.dtd, page.dtd or album.dtd. Or a user-provided DTD when extensibility is used. This command takes the DTD name of the document and maps it to a corresponding XSLT sheet according to the convention <DTDname>2html.xsl. For example the DTD name "album" maps to album2html.xsl. The XSLT file name is searched through the CLASSPATH, first prefixed with nl/justobjects/xbook/rsc/xsl/. If not found through the name itself.
xdoc.bat|sh <source XML file> [destination HTML file];
See the test/doc|album|page|extend example directories.
XBook generation can be done through the <xbook> optional Ant task provided with the XBook distribution (see XBookAnttask.java) or directly using the standard Ant <java> task.
Basically you need to specify two things in the Ant build.xml file: the taskdef for xbook and the actual xbook task. The xbook task takes the standard parameters also used in the script: book, dest and lite (boolean). Important is that Ant can find xbook.jar and xbookaux.jar This may be done by providing these jars within the classpath, through standard Ant extensibility or explicitly when defining the task (as done in the example). NOTE: conflicts may arise when Xalan is in your Ant lib dir. You may then see something like "nl.justobjects.xbook.XSLTHelper class not found". In that case you may better invoke xbook through a standard Ant java task (see below). The xbook task takes the standard parameters also used in the script: book, dest and lite (boolean).
Here is an example:
|
This is often the safest way when CLASSPATH issues and Xalan conflicts arise when using the XBookAntTask. Here is an example.
|
Below is the XBook project Ant build file for the documentation where the two ways of invoking XBook within Ant are provided.
|
[W3C] |
World Wide Web Consortium.
http://www.w3c.org
|
[W3C-XML] |
World Wide Web Consortium. Extensible Markup Language (XML) 1.0.
W3C Recommendation;
http://www.w3.org/TR/1998/REC-xml-19980210
|
[WordAssociationFootball] |
Monty Python's WordAssociationFootball
|