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

Reply via email to