This section describes how to XSL transformation is used in hyPub to transforming book source files, adding page layout and formatting information in Web pages.
XSL technology is used in hyPub in many ways:
1. Splitting the book source file into Web page files, one file per chapter and section.
2. Adding layout and formatting information into Web page files.
3. Adding FO (Formatting Objects) for PDF generation.
Splitting the Book Source File
In order to publish a book on the Web, we need to split the book source file into smaller Web page files.
One easy way to do this is to use an XSL template.
Here is a sample XSL template that can be used to split chapters out of the book source file:
Notice that a special Xalan-Java command "redirect:write" is used to write out output to new files.
Adding Layout Information to Web Pages
If you want to add some extra HTML code to create a Web page layout, you have to add that extra HTML code to all Web page files.
One quick way to do this is to use XSL templates.
Here is a sample XSL template that can be used to add HTML table structure all Web page files: