Data attributes customize how a document displays content.
Use data attributes to add a table of contents and to customize calculated
values, define conditions, filters, conditional formatting properties,
and styles.
Calculated values
Create JavaScript snippets to process
data attributes. You might use these snippets to combine data attributes,
trim white space, and transform numeric values into textual descriptions.
You can process any data attribute from the current context, which
includes the query attributes of the element and the attributes from
all the parent queries of the elements.
Conditions
Use expressions that are based on
data attributes or template variables to define conditions for when
an element is to be rendered. A condition is a JavaScript expression that
evaluates to a Boolean value.
Filter versus conditions
Although filters and
conditions seem similar, they are two different mechanisms that serve
different purposes:
- A filter can be evaluated as the data is extracted from the data
source.
- A condition is evaluated only after the data is extracted from
the data source.
A condition is evaluated only once for an element, even if that
element is a query. Therefore, you cannot use the current query as
a context for a condition.
Although you can sometimes use conditions
instead of filters, using filters yields better performance because
only a subset of data is processed.
Conditional formatting
You can use expressions
to define formatting properties based on data attribute values. Conditional
formatting is similar to element conditions except that the return
values depend on the property type.
Editable elements
You can edit the content
for: text, styled text, image, include file, bookmark, and hyperlink.
Double-click the elements to edit its content.
Tables of contents, figures, and
tables in Microsoft Word
documents
To add a table of contents to your output, define
the table of contents in your template or style sheet. If you define
the table of contents in the template, the table is not shown in the Microsoft Word document until
you update the document fields. To update the fields, use the Update
Fields or Update Table feature in Microsoft Word
or use the macros contained in the rpe.dot style
sheet. You can find the rpe.dot style sheet in
the Rational® Publishing Engine installation: %RPE_HOME%\utils\word\rpe.dot.
The same process applies to tables of figures and tables of tables.
Captions in Microsoft Word documents
Figure
and table captions are not automatically updated. To update the fields,
use the Update Fields feature in Microsoft Word
or use the macros contained in the rpe.dot style
sheet. You can find the rpe.dot style sheet in
the Rational Publishing Engine installation: %RPE_HOME%\utils\word\rpe.dot.
Heading styles
To use the
predefined heading styles for Microsoft Word
(Heading 1, Heading 2, ... , Heading 9) and HTML (H1, H2, ... , 9),
use the style name 1,2, to 9. PDF and XSL-FO output formats do not
have heading styles; however, Rational Publishing Engine uses
internally defined heading styles.
Formatting properties versus styles
Define
styles instead of changing individual formatting properties for template
elements.
Rational Publishing Engine styles
versus external styles
If your main output is Microsoft Word or HTML, use external styles,
which are defined in a style sheet, as much as possible. This approach
allows you to quickly change the appearance of the output document
and enforces a uniform look across the company.
Numbering headings for Microsoft Word
Use a style sheet
with numbered headings to obtain headings numbered as a hierarchical
list.
Unicode data in output
All
Unicode data is rendered if the font that is used supports Unicode.
- For PDF output, additional configuration is necessary. See the PDF
output settings for details. If you used a non-Unicode font,
generate the document again using True Type Unicode fonts and set
the appropriate output properties.
- For Microsoft Word
output, if you used a non-Unicode font, change the font in the output
document after document generation.
- For HTML output, if you used a non-Unicode font, change the font
family in the style sheet after document generation.