Skip to content

Tag Definition: docIf

Generated by rlextra version 3.6.13

Attributes

Name

Required?

Default_Value

Values

cond

required

None

Can contain
((para | blockTable | title | h1 | h2 | h3 | h4 | h5 | h6 | spacer | ul | ol | dl | illustration | graphicsMode | storyPlace | pre | xpre | codesnippet | plugInFlowable | drawing | outlineAdd | namedString | bookmarkPage | bookmark | name | hr | indent | frameBackground | fixedSize | keepInFrame | imageAndFlowables | imageFigure | figure | barCodeFlowable | keepTogether | docWhile | docIf | docAssign | docExec | docAssert | docPara | showIndex | topPadder | pto | placeString | placeRightString | placeCentredString | placeCenteredString | placePara | placeXPre | setTopFlowables | setPageTopFlowables | balancedColumns | loop_b | switch_b | assign_b | if_b | script_b | doclet | alias | nextPage | nextPageIfNotEmpty | nextFrame | setNextFrame | setNextTemplate | switchTemplate | condPageBreak | includePdfPages | log | warn | debug | info | error | critical)*, docElse, (para | blockTable | title | h1 | h2 | h3 | h4 | h5 | h6 | spacer | ul | ol | dl | illustration | graphicsMode | storyPlace | pre | xpre | codesnippet | plugInFlowable | drawing | outlineAdd | namedString | bookmarkPage | bookmark | name | hr | indent | frameBackground | fixedSize | keepInFrame | imageAndFlowables | imageFigure | figure | barCodeFlowable | keepTogether | docWhile | docIf | docAssign | docExec | docAssert | docPara | showIndex | topPadder | pto | placeString | placeRightString | placeCentredString | placeCenteredString | placePara | placeXPre | setTopFlowables | setPageTopFlowables | balancedColumns | loop_b | switch_b | assign_b | if_b | script_b | doclet | alias | nextPage | nextPageIfNotEmpty | nextFrame | setNextFrame | setNextTemplate | switchTemplate | condPageBreak | includePdfPages | log | warn | debug | info | error | critical)*?)

Purpose

This lets you include the equivalent of an if condition with just a template.

See the relevant docs here docs

Example usage

<story>
    <docAssign var="i" expr="4"/>
    <docIf cond="i==4">
        <para>This is the IF</para>
        <docElse/>
        <para>This is the Else</para>
    </docIf>
</story>

Note: Only relevant sections are used in this snippet. Some tags were not included. See some of our samples for further insight of how you may go about setting up a full document using rml.

Example of nesting path from the parent tags to the current tag

<document> ➔ <story> ➔ <docIf>