Paragraph vs Container in RPE
- October 4th, 2010
- Author:
- Category: RPE Template
- Discussion: 1 Comment
There are several differences between the Paragraph element and the Container element.
- The Container element does not provide to the user formatting features.
- The Container purpose is only to be a placeholder for other Rational Publishing Elements.
- The Paragraph element provides a large set of formatting properties, including styles.
- A Paragraph can be a placeholder for other RPE elements also but it will inset a new line at the start.
- An empty Container does not produce any entry in the output document while an empty Paragraph will insert an empty line in the output document.
The main question is when to use Paragraphs and when to use Containers?
- The Paragraph should be used when we want to display in the output document a text in a separate paragraph, with or without formatting settings.
- The Container is proving to be useful in the following situation:
- Suppose we have a query a.b that has two attributes: attr1 and attr2. We want to display the value of the attribute attr1 of this query only if the value of attr2 is not empty. We need to use the following condition attr2 != “”. If the query is set on a Paragraph, in case that the condition is not true, in the output document we will have and empty line. To avoid this, we will use a Container. We will set the a.b query to the Container. In the Container we will create a Paragraph. The condition will be set to the newly created Paragraph. In the Paragraph we will create a Text element having as content a Data Expression referring the attr1 of the a.b query. In this situation we will not have empty lines in the output document in case that the value of the attr2 is empty.
- Containers can be also used in Tables, Rows and List for the same purpose as the one described above
the example really helped me fix a problem I was having with a java filter returning blank lines. Thank you!
Heidi