You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Karr, David" <da...@wamu.net> on 2006/07/21 23:11:00 UTC
[jelly] How to define tag inline as "subroutine" that is only executed when called?
I now need to define blocks that I can call at different times, with
different parameter values. It looks like this would be done with the
"tag" tag. I'm guessing that I don't define what parameters it can
take, it will just take any XML attributes set in the tag call and
assign those to implicit variables.
So, I figured I would define these near the top of my script, and call
them further down. What I found is that when I executed my script, it
tried to execute the body of my defined tag, even before I had called it
(it complained about variables not being set).
How do I define a new tag, or block, or something, so that it's only
called when I need to call it?
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [jelly] How to define tag inline as "subroutine" that is only
executed when called?
Posted by Paul Libbrecht <pa...@activemath.org>.
Karr, David wrote:
> I now need to define blocks that I can call at different times, with
> different parameter values. It looks like this would be done with the
> "tag" tag. I'm guessing that I don't define what parameters it can
> take, it will just take any XML attributes set in the tag call and
> assign those to implicit variables.
>
<j:jelly
xmlns:j="jelly:core"
xmlns:define="jelly:define"
xmlns:dx="x">
<define:taglib uri="x">
<define:tag name="b">b</define:tag>
</define:taglib>
<dx:b/><dx:b/>
</j:jelly>
does output bb
> Thanks. I did manage to find them, although by sort of an awkward path.
> I found a note in the mail archive showing replacements of the contents
> of those scripts, so I was able to see a reasonably current state of
> them. This link to the repository is a better way to get to them. I
> wish this link was on the Jelly site. I imagine it's up on the Jakarta
> site.
Mmmmh... that's in the normal place where it is always for
maven-generated sites and where I extracted it from:
- jelly site
- project-info
- source-repository
Maybe we do not cultivate well enough yet a notion of search of our
web-site...
paul