From: Rafal Krzewski [mailto:[EMAIL PROTECTED]]

> "Geir Magnusson Jr." wrote:
>
> > Since you now have to sprinkle Velocimacros around every
> single use of the
> > technique you want to use :
> >
> >  #macro(ident,
> $value)$xml.turnOff(true)$value$xml.turnOff(false)#end
> >
> > Why not just do the escaping in the Velocimacro itself?  Or use a
> > context-based tool directly?
>
> As I understand, this macro is for the 5% of the cases when data is
> placed in the template *unescaped*, hence ident=identity.
> In the other 95% of the cases, no extra VTL markup is needed
> to perform
> the escaping, which makes the way more readable.
>
> For me, the Listener registered in the context sounds sensible and I
> give my non-commiter +1 to it.

I am actually +1 on the general idea myself, but the contextual issue is
bothersome - if in reality the contextual problem arises sparingly, and it
won't be an issue, than I think it's a good thing because it's a
significantly superior solution to the 'diddle the template' approach.
However, if thats not the case, and the majorty of use will have to be
augmented with local/contextual template alteration, then we may be creating
something that will, via performance or complexity, affect 99% of the users
adversely to provide simply a more conceptually convenient but in practice
not useable solution for 1% of the users. Then this discussion is worth it.

There are a few things which I have been planning to solve this way, such as
the whole 'log on null assignment' issue that is Christophs' favorite, the
whole bit about weather or not to log when on a ReferenceException (a $<foo>
isn't conditionally a reference but you know it and don't want it logged...)
and there was another one (that got me playing with this a while ago),
although I don't remember off the top of my head what it was.

Performance will be a big issue.

I'll whiteboard what I have so far if I can find it and some time tongiht.

geir

Reply via email to