4. A Quick Tour

This section introduces the main features of XBook. The XBook Guides provide more extensive covering for authoring, generation and extensibility..

4.1. XML Documents

Well, the document you are reading right now was originally written in XML. XBook provides several lightweight DTDs for writing documents. Using the xdoc commands in the bin directory you can quickly convert this type of XML documents to HTML. You may use XBook just for producing stand-alone documents and even add your own DTDs and XSLT stylesheets.

See XBook authoring guides.

4.2. Writing the Book

Consider having a bunch of documents, some may be written in XML using doc.dtd, others may be generated (Javadoc or TogetherJ) or directly written in HTML. How can you organize this wild bunch into a set of coherent indexed web pages ?

XBook provides a book DTD called book.dtd. This DTD allows you to specify the hierarchical structure of your book in XML and how to integrate external (non-XML) documents through directives. Using one of the xbook commands from the bin directory you can generate an entire indexed website containing all documents. Any XML-documents specified in your book.xml are automatically converted to HTML (using xdoc) in the process. External documents and assets (images, applets etc) may be copied dependent on directives (as attributes) you provide in book.xml.

See XBook Authoring Guide.

4.3. No XML, No Problem

You are not obliged to write documents in XML, except for the book.xml. You may in some cases just create a book.xml with just external documents, for example to quickly generate a website. For this purpose you may want to use xmenu which is used internally to generate the site after all the book and all documents have been processed.

See also the Menu Authoring Guide

4.4. No DHTML, No Problem

In the default case the xbook command generates an DHTML-based site (through XMenu). However not all browsers support DHTML to the same extend. In this case you may want to use the -lite commandline option to generate a lightweight pure HTML site. Note that in the default (DHTML) the lightweight menu is generated as well. Browsers not supporting NS/MSIE compatible DHTML are automatically redirected to the lightweight pages (index-lite.html).

4.5. Automation with Ant

XBook provides an Ant-task in order to generate your documentation as part of your Ant build. This is very handy for project documentation.

See XBook Generation Guide.

4.6. Extensibility: Adding your own DTDs and XSLT files

Several standard DTDs and corresponding stylesheets (XSLT) are provided by XBook but you can very easily add your own DTDs and transform documents according to your DTDs with your own XSLT stylesheets. Examples are provided in the distribution (directory: test/extend).

See the Extensibility Guide.