Preparing DITA Source Documents : Using markopen and markclose
Using markopen and markclose
This default.wwconfig modification specifies the start and a stop of an element. This is especially useful for the implementation of the dropdown elements in WebWorks Help 5 or WebWorks Reverb output. ePublisher has preconfigured items such as the Defintion Term Elements, below is an example of the sample DITA markup:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="simplelist" xml:lang="en-us">
<title>Definition List</title>
<p>Definition list</p>
<dthd>Image File View Selection</dthd>
<ddhd>Resulting Information</ddhd>
<dt>File Type</dt>
<dd>Image's file extension</dd>
<dt>Image Class</dt>
<dd>Image is raster, vector, metafile or 3D</dd>
<dt>Number of pages</dt>
<dd>Number of pages in the image</dd>
<dd>Names of the fonts contained within a vector image</dd>
<p>Content after the definition list.</p>
Without the use of the markclose in the default.wwconfig, the last paragraph would be underneath the last Definition Term element. To make sure that no other elements are inside the dropdown, you can assign markclosed to it by creating an override to default.wwconfig located in [project directory]\Formats\Adapters\xml\scripts\dita. For more information, refer to “Creating Format Overrides” Below is an example of the modification needed to get the desired output:
<!-- Mark open/close on definition entries -->
<!-- -->
<Style match="//*[contains(@class, ' topic/dlentry ')]">
<xsl:variable name="VarName" select="'Definition List Entry'" />
<wwditaconfig:Head name="{$VarName}" markopen="{$VarName} Open" markclose="{$VarName} Close" />