You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Vincent Massol <vm...@pivolis.com> on 2003/11/02 15:21:59 UTC
[Jelly] invokeBody with nested tags?
Hi,
I'd like to create a dynamic tag which can be used with nested tags.
Here's what I'd like to write:
<define:taglib uri="cactus">
<define:tag name="cactus">
<cactus [...]>
[...]
<define:invokeBody/>
</cactus>
</define:tag>
</define:taglib>
Then, it would be used like this:
<cactus:cactus>
<ant:batchtest>
<ant:fileset dir="${cactus.src.dir}"
includes="${cactus.src.includes}"
excludes="${cactus.src.excludes}"/>
</ant:batchtest>
</cactus:cactus>
I would like this to be equivalent to a call to:
<cactus [...]>
[...]
<ant:batchtest>
<ant:fileset dir="${cactus.src.dir}"
includes="${cactus.src.includes}"
excludes="${cactus.src.excludes}"/>
</ant:batchtest>
</cactus>
Is that possible? I've tried it and it seems the <ant:batchest>[...]
part is simply ignored.
Does invokeBody only works with text? Can it work with nested tags too?
How can I achieve the above?
Thanks a lot
-Vincent
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
RE: [Jelly] invokeBody with nested tags?
Posted by Vincent Massol <vm...@pivolis.com>.
Thanks Peter,
Here is an example (I've created
http://jira.codehaus.org/secure/ViewIssue.jspa?key=JELLY-95):
<project
default="mytest"
xmlns:j="jelly:core"
xmlns:maven="jelly:maven"
xmlns:ant="jelly:ant"
xmlns:define="jelly:define"
xmlns:mytaglib="mytaglib">
<define:taglib uri="mytaglib">
<define:tag name="mytag">
<ant:condition property="ok">
<define:invokeBody/>
</ant:condition>
</define:tag>
</define:taglib>
<goal name="mytest">
<mytaglib:mytag>
<ant:equals arg1="arg" arg2="arg"/>
</mytaglib:mytag>
Result = ${ok}
</goal>
<goal name="mytest2">
<ant:condition property="ok2">
<ant:equals arg1="arg" arg2="arg"/>
</ant:condition>
Result = ${ok2}
</goal>
</project>
Calling mytest fails whereas mytest2 works.
Thanks
-Vincent
> -----Original Message-----
> From: peter royal [mailto:proyal@apache.org]
> Sent: 03 November 2003 03:28
> To: Jakarta Commons Developers List
> Subject: Re: [Jelly] invokeBody with nested tags?
>
> On Nov 2, 2003, at 9:21 AM, Vincent Massol wrote:
> > Does invokeBody only works with text? Can it work with nested tags
too?
> > How can I achieve the above?
>
> From what I know, it *should* work. invokeBody invokes nested tags
when
> called from tags defined in java, i don't see why it should be
> different for jelly-based tags. if you work up a testcase and stick it
> in jira, that'll increase chances of other eyes looking at it :)
> -pete
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [Jelly] invokeBody with nested tags?
Posted by peter royal <pr...@apache.org>.
On Nov 2, 2003, at 9:21 AM, Vincent Massol wrote:
> Does invokeBody only works with text? Can it work with nested tags too?
> How can I achieve the above?
From what I know, it *should* work. invokeBody invokes nested tags when
called from tags defined in java, i don't see why it should be
different for jelly-based tags. if you work up a testcase and stick it
in jira, that'll increase chances of other eyes looking at it :)
-pete
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org