Table of contents

Abstract

Hacking vs. elegance

DITA OT Overview

CSS changes

HTML headers and footers

Modifying XSL transforms

Packaging up your overrides

Hacking and specialization

Summary

HTML headers and footers

The DITA OT allows you to specify files that contain boilerplate headers, footers, and HTML <head> information.

You specify the locations of these files with the Ant properties listed in Table 1.

Table 1: Ant properties for headers and footers

Property Name

Specifies

args.hdr

The running header for the output file.

args.ftr

The running footer for the output file.

args.hdf

Additional information for the HTML <head> tag. This is useful for specifying metadata or additional link information.


The files referenced by these properties must contain well-formed XML. If you’re using HTML, your HTML must meet all strict XHTML rules, including balanced open and close tags (<li> and </li>), empty tags for stand-alone elements (<hr/> and <br/>), quoted attribute values -(attribute="value"), and so on.

The example shown here illustrates how to add a footer. The steps for adding a header or <head> tag information is similar, only you use a different property name and specify a different file.

To add a copyright footer to your HTML pages:

  1. Create a footer file in the resource folder, named my_footer.html, that contains:
  2. <p class="copyright_footer"> Copyright &#169; 2009 Scriptorium Publishing Services. All rights reserved. </p>

  3. Modify your Ant project file(my_xhtml.xml), adding this line near the location indicated by the ➌ in the example on page 4:
  4. <property name="args.ftr"                  value="${dita.dir}${file.separator}resource${file.separator}my_footer.html"/>

When the DITA OT processes a source document, this footer is inserted automatically near the end of the output:

<p class="copyright_footer"> Copyright © 2009 Scriptorium Publishing Services. All rights reserved. </p>

 

Next Page:
Modifying XSL transforms


Scriptorium Publishing | Post Office Box 12761 Research Triangle Park, NC 27709 | (919) 481 2701 | info@scriptorium.com