How to flag DITA content in WebHelp output using a publishing template

Flagging content in WebHelp output involves defining a set of images that will be used for marking content across your information set.

To flag DITA content, you need to create a filter file that defines properties that will be applied on elements to be flagged. Generally, flagging is supported for block elements (such as paragraphs), but not for phrase-level elements within a paragraph. This ensures that the images that will flag the content are easily scanned by the reader, instead of being buried in text.

To flag content in the DITA Map to WebHelp output using an oXygen Publishing Template, follow this procedure:

  1. Create a DITA filter file in the directory where you want to add the file. Give the file a descriptive name, such as audience-flag-build.ditaval.
  2. Define the property of the element you want to be flagged. For example, if you want to flag elements that have the audience attribute set to programmer, the content of the DITAVAL file should look like the following example:
    <?xml version="1.0" encoding="UTF-8"?> 
    <val>
      <prop att="audience" val="programmer" action="flag"
     img="D:\resource\delta.gif" alt="sample alt text"/>
    </val>
    Note: For an element to be flagged, at least one attribute-value pair needs to have a property declared in the DITAVAL file.
  3. Open the template descriptor file associated with your publishing template and add the args.filter parameter in the parameters section with its value set to the path of the DITAVAL file.
    <publishing-template>
        ...
        <webhelp>
            ...                
            <parameters>
                <parameter name="args.filter" value="resources/myFile.ditaval"/>
            </parameters>
        </webhelp>
  4. Open the DITA Map WebHelp Responsive transformation scenario.
  5. Click the Choose Custom Publishing Template link and select your template.
  6. Click OK to save the changes to the transformation scenario.
  7. Run the transformation scenario.