Template types

Previous pageReturn to chapter overviewNext page

This section is not intended to be a complete XSL/XML tutorial, but will give you some basic information on the different types of xsl templates that BookCAT uses. For more information about XSL and XML, see http://www.w3schools.com/xsl and http://www.w3schools.com/xml.

BookCAT uses three different template types. The type of template is determined by the data type instruction at the beginning of the xsl template file. Possible values are:

<?data type="index"?>

<?data type="record"?>

<?data type="list"?>

Index

This type of template is only used by the Explorer view, and in the Explorer window when you click the Home button. Use the newrecords instruction to specify how many of the latest additions to the database that should be available to the index page (0 - 99), for example <?data newrecords="5"?>.

For an example of this template type, see Index.xsl.

Record

This type of template is used to create a document with data about one specific record. Use the data table instruction to specify which table the data should be taken from, for example <?data table="book"?>.

For an example of this template type, see Book.xsl.

List

This type of template is used to create a document with a list of multiple records. Use the data table instruction to specify which table the data should be taken from, for example <?data table="book"?>.

In addition, use the data recordspage instruction to specify the maximum number of records you want to be displayed on one page, for example <?data recordspage="30"?>. If the number of records in the list is greater than this, the program automatically splits the list up into several pages with links to the other pages at the bottom of the current page. If you don't add this instruction, the program will display 25 records per page.

For an example of this template type, see BookList.xsl.

The explorer pane is by default displayed below the browse list. To display the explorer pane to the right of the browse list, add the <?data previewpanepos="right"?> instruction to the xsl template file. For an example, see the BookBrowse_Right.xsl template.