Using data attributes

Data attributes customize the way document displays its contents. Use data attributes to customize calculated values, define conditions, filters, conditional formatting properties, and styles; and to add a table of contents.

Calculated values

Use the editor area to create Javascript snippets that process data attributes. Examples of processing include combining data attributes, trimming white space, and transforming numeric values into textual descriptions. You can process any data attribute from the current context (the query attributes of the element and the attributes from all the parent quires of the elements).

Conditions

Use expressions that are based on data attributes or template variables to define conditions for when an element should be rendered. A condition is a Javascript expression that evaluates to a Boolean value.

Filter vs. conditions

Although filters and conditions seem similar, they are two different mechanisms that serve different purposes:
  • A filter can be evaluated as data is extracted from the data source.
  • A condition is evaluated only after the data has been 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 Word documents

To add a table of contents to your output, define the table of contents in your template or your in the style sheet. If you define the table of contents (or table of figures, table of tables) in the template, the table is not shown in Microsoft Word until you update the document fields. To update the fields, use the Update Fields or Update Table feature in Word or use the macros contained in the rpe.dot stylesheet. You can find the rpe.dot stylesheet in the Rational Publishing Engine installation: %RPE_HOME%\utils\word\rpe.dot.

Captions in Word documents

Figure and table captions, like the table of contents, 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 stylesheet. You can find the rpe.dot stylesheet in the Rational Publishing Engine installation: %RPE_HOME%\utils\word\rpe.dot.

Include files

The way include file elements are handled depends on the output format. For PDF, HTML, and XSL-FO output, the included file is a hyperlink. For Microsoft Word output, an INCLUDE TEXT field is generated. This means that the task of importing the file is delegated to Microsoft Word. An include file is not visible in the output document until all fields are updated. To update the fields, use the Update Fields feature in Word or use the macros contained in the rpe.dot stylesheet. You can find the rpe.dot stylesheet in the Rational Publishing Engine installation: %RPE_HOME%\utils\word\rpe.dot.
Note: A Word document linking other files is not self-contained. Moving the document on other computers prevents you from visualizing the content of the linked documents. If visualization is needed, use the Break links feature (Alt+E+K in Office 2007) from Microsoft Word to include the contents of a linked files.

Heading styles

To use the predefined heading styles for Microsoft Word (Heading 1, Heading 2,....,Heading 9) and HTML (H1, H2,....,H9) use the style name 1,2, to 9. PDF and XSL-FO, not have heading styles. However, Rational® Publishing Engine use internally defined heading styles.

Formatting properties vs. styles

You should define styles instead of changing individual formatting properties for template elements.

Rational Publishing Engine styles vs. external styles

If your main output is Microsoft Word or HTML, you should use external styles (defined in style sheet) as much as possible. This approach allows changing the appearance of the output document on the fly and enforces a uniform look company wide.

Numbering headings for Microsoft Word

Use a style sheet that has numbered headings to obtain headings numbered as a hierarchical list.

Unicode data in output

All Unicode data is rendered if the font 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 setting the appropriate output properties.
  • For 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.

Feedback