Documentation Center

Using XSL from the DITA Open Toolkit

For style development teams that have already customized the HTML or PDF output through the DITA Open Toolkit, this investment in XSL styles can be carried over into Legacy Content Delivery.

About this task

The HTML and PDF XSL styles in Legacy Content Delivery are based upon those provided by the DITA Open Toolkit. Therefore, by loading the DITA Open Toolkit styles into a skin, you can get a foundation on which to complete your styling work. This task details the changes you will need to make to your DITA Open Toolkit styles in order for them to function within the Legacy Content Delivery XSL environment. In addition, you may need to make additional changes to allow special structures like linking and images, which Legacy Content Delivery has customized, to continue to function properly.

Legacy Content Delivery makes specific modifications to the DITA Open Toolkit styles via higher priority templates in the ContentDelivery_home/db/LiveContent/ui/skins/base/xsl/DITA/html.xsl file. As examples, special templates are provided to handle the following special structures:

  • Cross references (xref) to use custom JavaScript to resolve and handle links internal to a document, external to a document, or between documents. Cross references within image map objects (imagemap) receive similar handling.
  • Links to images (@href attributes on image elements) to use Legacy Content Delivery-specific linking as opposed to standard DITA Open Toolkit links. Images that use a @scale attribute also receive special processing.
  • Multimedia objects (object) are processed to output JavaScript snippets which will generate multimedia tagging on the web browser. See Displaying Multimedia for additional details.

ContentDelivery_home refers to ContentDelivery_InstallDir\WEB-INF on Windows and ContentDelivery_InstallDir/WEB-INF on Linux.

Procedure

  1. Create a new skin. See Adding a Skin and Resources.
  2. Add your DITA Open Toolkit XSL styles into the ContentDelivery_home/db/LiveContent/ui/skins/<your skin>/xsl/DITA/ folder and subfolders. the XSL template you need to override, or the XML node you need to match. As in basic XSL, Legacy Content Delivery XSL customizations are organized around the ability to add priority or mode to override templates in the core XSL with customized templates.
    For example, many of your HTML styles should be placed into ContentDelivery_home/db/LiveContent/ui/skins/<your skin>/xsl/DITA/xslhtml while the language message files would be placed in ContentDelivery_home/db/LiveContent/ui/skins/<your skin>/xsl/DITA/common/
  3. Check each custom XSL that uses an <xsl:include/> to reference another XSL stylesheet. These links must reference existing files and XSLs, as they will appear within your skin on the file system.
  4. Upload the new skin customization into the database.
    • You can upload the resources using the web UI, as described by Adding a Skin and Resources.
    • You can also update the skins via the command line using the loaddb tool. Copy the updated skin resources from the source code repository to ContentDelivery_home/db/LiveContent/ui/skins/<your_skin>/.
      • On Windows, to load the most recent changes into the database run this command:

        loaddb.bat UPGRADE

      • On Linux, run this command:

        loaddb.sh UPGRADE