You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Dave, Tejas" <Te...@pbs.proquest.com> on 2007/03/06 22:32:26 UTC

How can I get the references in the Template?

Hi All,

Can someone please tell me how can I get the references from the
template? In my application I have to generate XML file for some data
and would like my code to be dynamic such that it picks up the
references from the Template file and only puts those data values in the
context rather then the whole bunch of objects. This would help me such
that if I change my template file I would not need to change the code.

I saw some method like getKeys() in the Context but really don't know
how it works. I tired it but it is not serving the cause. So can someone
please help me to get the references from the template

Thanks and looking forward to your replies.
Tejas

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Re: How can I get the references in the Template?

Posted by Nathan Bubna <nb...@gmail.com>.
yeah, getKeys() tells you what is available to the template, not what
the template is looking for.  To do that, you have to process the
template itself.  You could use this:

http://svn.apache.org/repos/asf/velocity/engine/trunk/experimental/templatetool/

On 3/6/07, Dave, Tejas <Te...@pbs.proquest.com> wrote:
> Hi All,
>
> Can someone please tell me how can I get the references from the
> template? In my application I have to generate XML file for some data
> and would like my code to be dynamic such that it picks up the
> references from the Template file and only puts those data values in the
> context rather then the whole bunch of objects. This would help me such
> that if I change my template file I would not need to change the code.
>
> I saw some method like getKeys() in the Context but really don't know
> how it works. I tired it but it is not serving the cause. So can someone
> please help me to get the references from the template
>
> Thanks and looking forward to your replies.
> Tejas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org