Wrap DITA Simple Lists

Description

Preserve <sl> elements as <div>s in generated HTML.

Method

Making this happen requires two things:

DITA to WIF

The first requirement can be accomplished by creating an override to the DITA styles configuration file:

We add a new style rule for ' topic/sl ' elements with the @markopen and @markclose attributes:

This will preserve the location of the start/end of the <sl> container element.

WIF to HTML

With the start and end locations recorded in WIF, we can now customize content.xsl to emit the open/close <div> element pair in our HTML output. To do this, we will need to escape the markup for each div tag so that it conforms to XML/XSL coding.

Therefore, <div> will be encoded as &lt;div&gt;.

Using a wwtransform:super customization, the entire content.xsl override for HTML becomes:

Example

Sample project which implements the above customizations is attached as Simple Lists.zip.

DevCenter/Projects/Wrap DITA Simple Lists (last edited 2012-11-14 00:00:07 by BenAllums)