Generate conditional output

This section covers, with a sample use-case, the steps to generate a PDF output containing condi­tional content.

note:    The sample used in this section includes content only in paragraph (p) tags. You can, however, create conditional output from any DITA element in a document.

1)Create a DITA topic with four paragraph (p) elements:

a)Content ONLY for administrators.

Set the audience attribute to admin.

b)Content ONLY for authors.

Set the audience attribute to author.

c)Content for administrators and authors

Set the audience attribute to admin author.

d)Content for end users and authors.

Set the audience attribute to end_user author.

2)Save the document.

3)Create ditaval file with four prop elements:

a)attr: audience

val: admin

action: include

b)attr:audience

val:author

action: exclude

c)attr:audience

val:end_user

action: exclude

The above ditaval will output all content targeted at administrators.

4)Create a ditamap and include the above document and save the ditamap as a PDF (File > Save).

5)In the Save Document dialog, check the Prompt For DitaVal File option and click Save.

6)Select the ditaval file created in step 4 and click Choose.

The Apply As Condition option will output the entire contents. However, the contents that is marked as excluded in the ditaval file is output with a strike-through. You choose this option for document review. For example, use this option to indicate to a reviewer the contents that is marked as excluded.

7)In the PDF Setup dialog, click Set.

The output PDF file includes and excludes content based on the attributes that are set up in the docu­ment and the corresponding ditaval file.


September 30, 2016

Legal Notices | Online Privacy Policy