Include directive

Use the Include directive to instruct stream processing to insert one text within another text. This lets you define a commonly used segment of HTML or XML text once and then incorporate it where needed.

JSP equivalent

The include JavaServer Page tag provides a functionally identical capability for JSP-based stream rules. See JSP Tags — include.

Introduction

This directive is useful in source HTML text for user interface forms and displays, in source HTML text for correspondence, and in XML text for interfaces.

Use the Include directive to include any of six rule types:

This example inserts a part into the currently processed stream:

{INCLUDE STANDARD=NewHeader}

The Include directive can reference a rule that does not yet exist. At runtime, the referenced rule must exist.

Use the Rules Inspector tool to identify the class and name of included parts.

Complete syntax

In the syntax presentations below:

{INCLUDE [stream rule class or keyword] = name of the included part [. correspondence or XML qualifier]}

All text inside the brace characters is case-insensitive.

If the stream rule class is Rule-Obj-Corr, use a period and the correspondence type (Rule-CorrType name) as the correspondence qualifier to identify two key parts of a correspondence rule. For example, the standard correspondence type email can appear:

INCLUDE Rule-Obj-Corr = SuccessCorr.email

Similarly, if the stream rule class is Rule-Obj-XML, use a period to separate the second and third key parts of the target XML Stream rule. For example,

INCLUDE Rule-Obj-XML = Contact.MapFrom

If you omit the stream rule type or keyword before the equal sign, the system assumes a rule type that depends on the class of the current rule:

In a rule of this rule type:

The default stream rule type is:

Rule-HTML-Property

Rule-HTML-Property

Rule-Obj-HTML

Rule-HTML-Fragment

Rule-Obj-Corr

Rule-Corr-Fragment

Rule-Corr-Fragment

Rule-Corr-Fragment

Rule-Obj-XML

Rule-Obj-XML

Use these keywords before the equal sign to use a value other than the default, or enter a rule type:

Keyword

Meaning

Rule-Obj-HTML, or other types listed above.

Rule-Obj-HTML, or the rule type specified.

Standard

Rule-Obj-HTML, Rule-Obj-Corr, or Rule-Obj-XML, depending on the rule type of the current rule.

Stream (deprecated)

Same as Standard.

NoInput

Rule-Obj-HTML with all input disabled.

Fragment

Rule-HTML-Fragment or Rule-Corr-Fragment, depending on the type of the current rule.

Property

Rule-HTML-Property.

FixedList

Rule-HTML-FixedList. (deprecated)

Directives within directives

You can embed one directive within the scope of another directive.

You can compute the argument to a directive at runtime, by concatenating values. Use the Reference directive to specify the values.

The Reference directive in this example uses the $SAVE keyword to name a directive that was previously saved with the Save directive.

{include {$save (includeSpecification)} }

The Reference directive in this example evaluates two other Reference directives to supply the values for class name and stream name.

{include '{myPage.pxStreamClass}={myPage.pxStreamName}'}

definitionsHarness form

Related topics About the Rules Inspector

Directives