Understand what is DITAval in FrameMaker and how it is used to generate conditional output in FrameMaker.
In FrameMaker, you use a DITAVAL file to generate conditional output. You write a single document with conditional content (using element attributes).
You then create a DITAVAL file in which you specify the content to create multiple outputs versions of the document based on the applied attributes.
See how you can setup DITA topics to use DITAval and apply conditional attributes to elements.
You can make elements in a DITA document conditional by applying condition attributes to the elements. You then define, in a DITAVAL file, the elements to exclude or include in the output based on the condition attributes.
Before you create documents with conditional content, you need to first plan the criteria for the output. For example, say that a document has content that is conditionally targeted at administrators and end users. In the document, you apply condition attributes based on the target audience of the content (see Applying condition attributes to elements). You then create a DITAVAL file in which you specify the elements to include and exclude based on the attribute value defined in the document. See Creating a DITAVAL file to create conditional output.
To allow FrameMaker to conditionally process elements in a DITA document, you need to specify the elements to include or exclude for the output. In the document, you apply one or more of the following conditional attributes to the elements that you need to conditionally process:
Example: administrators, authors, or end users.
Example: Windows, MAC, or Linux
Example: FrameMaker, RoboHelp, or Captivate.
Use this attribute to define any other property that you need to use to enable conditional processing for the document. A few examples:
Example: Print, PDF, or Web
hatchback or sedan
You can apply
multiple attributes to an element. For example, you can apply @audience
="administrator"
and @platform
="windows"
to
an element. You can also add multiple values (each separated by
a space) to a single attribute. For example, you can set @platform
="windows
linux"
for content targeted at both Windows and Linux.
Select an element in the Structure View of the document.
Open the Attributes panel ( ).
Update one or more of the following attributes:
audience
platform
product
otherprops
Specify the above condition for each of the element in the document that needs to be processed conditionally.
After you apply the attributes to the specific elements in the document, you conditionally output the content in your document depending on how you set up your DITAVAL file.
After setting up your content using condition attributes (audience, platform, product, and otherprops) to define the elements that FrameMaker conditionally processes for output, you need to create a DITAVAL file. In a DITAVAL file, you define, based on an <attribute name> - <value> pair, the conditional processing of your document. For example, you can specify that content targeted at administrators must exclude from the output content targeted at end users or authors.
Open the New XML dialog ( ).
In the Structured Applications section, select DITA_<version>_DITAVAL and click OK.
The
top element of a DITAVAL file is the <val>
element.
To
define conditions, you need to create <prop>
elements.
Add one or more <prop>
elements:
Double-click
the <prop>
element in the Element panel ( ).
Or press Ctrl+1 to display
the Smart Catalog and choose prop
and
press Enter.
In the Attributes for New Element dialog, specify the following attributes:
@action
Choose to include or exclude the specified attribute (@att
,
below) from the output.
@att
The condition attribute name applied to the element in your document.
Enter the attribute name exactly as it is defined in the document element.
@val
The condition attribute (@att
) value as defined
in the element.
Enter the value exactly as you specify it for the attribute in the element.
For example, say that you
apply the @audience
attribute to an element for
conditional output and you set the value as admin
.
You need to enter audience
in the @attr
field
for the prop element in the DITAVAL file. Also, you need to enter admin
in
the @val
field. To exclude the element with the
audience attribute set to admin
, specify the @action
as exclude
.
Click Insert Element and save the DITAVAL file.
Save the document with the .ditaval extension.
Know how you can generate conditional output for DITA topics in FrameMaker.
This section covers, with a sample use case, the steps to generate a PDF output containing conditional content.
Create a DITA topic with four paragraph (<p>
)
elements:
Content ONLY for administrators.
Set
the @audience
attribute to admin
.
Content ONLY for authors.
Set the @audience
attribute
to author
.
Content for administrators and authors
Set the @audience
attribute
to admin author
.
Content for end users and authors.
Set the @audience
attribute
to end_user author
.
Save the document.
Create DITAVAL file with four prop elements:
@attr
: audience
@val
: admin
@action
: include
@attr
:audience
@val
:author
@action
: exclude
@attr
:audience
@val
:end_user
@action
: exclude
The above DITAVAL will output all content targeted at administrators.
Create a DITA map and include the above document and save the DITA map as a PDF (
).In the Save Document dialog, check the Prompt For DitaVal File option and click Save.
The Choose DitaVal File dialog appears.
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.
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 document and the corresponding DITAVAL file.