Content filtering using FBA (Filter by Attribute)

FrameMaker allows you to conditionally filter content in structured documents. Elements in structured documents can have attributes associated with them. FBA feature filters content based on these attribute values.

So, you can author a single document and use FBA to create different output intended for different audience. Thus, it saves the burden of unnecessary authoring multiple documents having similar content.

An expression for filtering content can be created with the following operators:

  1. Equals Operator
  2. Any Operator
  3. Contains only Operator

Lets see what these operators mean.

Equals operator

If the attribute value (or one of the attribute values in case of multi-valued attributes) is equal to the one specified in the filter, the result is True. If the attribute value is unspecified, the result is Don’t-Care. If none of the attribute value matches the value specified in the filter, result is False.

For the attribute expression – (platform=”win”), the following table summarizes the result:

Attribute

Value(s)

Attribute Type

Result

platform

Single-valued

Don’t-Care

platform

win

Single-Valued

True

platform

unix

Single-Valued

False

platform

mac

Single-Valued

False

platform

win mac

Multi-Valued

True

platform

win unix

Multi-Valued

True

platform

unix mac

Multi-Valued

False

Any Operator

If the attribute value is specified the result is True else the result is Don’t-Care.

For the attribute expression – (platform #ANY), the following table summarizes the result:

Attribute

Value(s)

Attribute Type

Result

platform

Single-valued

Don’t-Care

platform

win

Single-Valued

True

platform

unix

Single-Valued

True

platform

mac

Single-Valued

True

platform

win mac

Multi-Valued

True

platform

win unix

Multi-Valued

True

platform

unix mac

Multi-Valued

True

Contains Only Operator

In case of single-valued attributes, if the attribute value is equal to one of the values specified in the filter, the result is True. If the attribute value is not specified, the result is Don’t-Care. If the attribute does not match any of the values specified in the filter, the result is False.
In case of multi-valued attributes, if each of the attribute values is equal to some value specified in the filter, the result is True. (i.e. result is True only if all the attribute values are contained in the filter specified). Again, if no attribute value is specified, result is Don’t-Care. If any of the attribute values is not contained in the filter, the result is False.

For the attribute expression – (platform # “win”, “unix”), following table summarizes the result:

Attribute

Value(s)

Attribute Type

Result

platform

Single-valued

Don’t-Care

platform

win

Single-Valued

True

platform

unix

Single-Valued

True

platform

mac

Single-Valued

False

platform

win mac

Multi-Valued

False

platform

win unix

Multi-Valued

True

platform

unix mac

Multi-Valued

False

Result Evaluation

If the final outcome of a filter is True or Don’t-Care, the element is included in the output. Element will be excluded from the output if the result is False. The following table lists the rules that FrameMaker uses to process complex filters:

<Don’t-care> OR <Don’t-Care>
<Don’t-Care>
<Don’t-care> OR <True>
<True>
<Don’t-care> OR <False>
<False>
<True> OR <Don’t-care>
<True>
<False> OR <Don’t-care>
<False>
<Don’t-care> AND <Don’t-Care>
<Don’t-Care>
<Don’t-care> AND <True>
<True>
<Don’t-care> AND <False>
<False>
<True> AND <Don’t-care>
<True>
<False> AND <Don’t-care>
<False>
NOT <Don’t-care>
<Don’t-care>
<True> OR <True>
<True>
<False> OR <True>
<True>
<True> OR <False>
<True>
<False> OR <False>
<False>
<True> AND <True>
><True>
<False> AND <True>
<False>
<True> AND <False>
<False>
<False> AND <False>
<False>
NOT <True>
<False>
NOT <False>
<True>

Now that we know how an expression is evaluated by FrameMaker, it’s time to go to the next step i.e. creating and applying a filter. The following animation explains the steps involved in creation and applying of a filter:

View video in a new browser window.

I hope this helps in understanding and creating expressions using the new operators (“Any” and “Contains Only”) introduced in FrameMaker 10. With the new set of operators we hope to provide a better way of filtering content and generating output.

Saurabh Agrawal,

Adobe FrameMaker Team