The point here is not how to escape but that the regular way to do this,
i.e., pass your value thru a function, or write a macro that calls that
function; they just polute the template and makes the whole thing dificult
to read.

The need is for a mechanism that can perform this transformations implicitly
without having to call something everytime we type "${....}".

Jose Alberto

> -----Original Message-----
> From: jvanzyl [mailto:jvanzyl]On Behalf Of Jason van Zyl
> Sent: Tuesday, April 03, 2001 9:32 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PROPOSAL] InsertionListener
>
>
> Leon Messerschmidt wrote:
> >
> > Hi,
> >
> > After looking at the possibilities mentioned on this list
> and playing around
> > with the idea I'd like to like to propose an
> InsertionListener as a solution
> > to the XML entity replacement problem.
> >
> > The InsertionListener interface will look something like this:
> >
> > public interface InsertionListener
> > {
> >     public String beforeInsert (String value)
> > }
> >
> > When a value is being inserted by ASTReference the
> beforeInsert () method is
> > called with the value to be inserted.  The Listener
> Implementation is free
> > to manipulate the string in any way and it returns the final string.
> >
> > I will add a setInsertionListener() method to the Context
> Interface.  An
> > alternative could be to add a listener to the template, but
> I think the
> > context allows for more freedom.
> >
> > Are there any objections if I go ahead with this?
>
> Sorry for not responding earlier, but I can't say I'm all that
> keep on adding methods to the context or template to transform
> your input.
>
> If I understand correctly you might be pull a string from a database,
> and that string needs to have the XML entities escape before being
> placed in your template? So:
>
> <text>[some text that may contain XML entities]</text>
>
> and you need to make sure that the text within your <text>
> tags is properly XML escaped? Just trying to make sure I understand
> the problem before I suggest something.
>
> --
> jvz.
>
> Jason van Zyl
> [EMAIL PROTECTED]
>
> http://jakarta.apache.org/velocity
> http://jakarta.apache.org/turbine
> http://tambora.zenplex.org
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to