You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by Apache Wiki <wi...@apache.org> on 2005/04/19 17:44:37 UTC
[Cocoon Wiki] Update of "JXTemplateGenerator" by LeszekGawron
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Cocoon Wiki" for change notification.
The following page has been changed by LeszekGawron:
http://wiki.apache.org/cocoon/JXTemplateGenerator
------------------------------------------------------------------------------
<tr><td bgcolor="blue">Ontario</td></tr>
</table>}}}
+ In cocoon 2.2-dev you can call your macro like this:
+ {{{
+ <jx:call macro="customTagName">
+ <jx:withParam name="paramA" value="someValue"/>
+ </jx:call>}}}
+
+ You are allowed to use expressions in macro name:
+ {{{
+ <jx:set var="macroName" value="customTagName"/>
+ <jx:call macro="${macroName}">
+ <jx:withParam name="paramA" value="someValue"/>
+ </jx:call>}}}
+
=== jx:out ===
Evaluates an expression and outputs the result of the evaluation:
{{{
@@ -162, +175 @@
jx-elements
</jx:template>
}}}
+
+ === jx:attribute (cocoon 2.2-dev) ===
+ Set's an attribute.
+ {{{
+ <jx:attribute name="Name" value="Value"/>}}}
+
+ Allows for conditional attribute injection. Example:
+ {{{
+ <jx:set var="a" value="cd"/>
+ <two>
+ <jx:if test="${a == 'dd'}">
+ <jx:attribute name="second" value="twoAttr"/>
+ </jx:if>
+ xyz
+ </two>
+ <three foo="bar">
+ <jx:attribute name="foo2" value="bar2"/>
+ <jx:attribute name="${a}" value="${a}"/>
+ <abc>def</abc>
+ </three>}}}
+ evaluates to:
+ {{{
+ <jx:set var="a" value="cd"/>
+ <two>
+ xyz
+ </two>
+ <three foo="bar" foo2="bar2" cd="cd">
+ <abc>def</abc>
+ </three>}}}
== Advanced ==