You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Leszek Gawron <lg...@mobilebox.pl> on 2004/07/21 16:15:39 UTC

VelocityGenerator and string escaping

I found VelocityGenerator hadly usable because of lack of value 
escaping. Example:

flow.js:
var elem = "<test>";
cocoon.sendPage( "view.vm", { elem: elem } );

view.vm:
<root>$elem</root>

this unfortunatelly produces:
<root><elem></root>
which is an invalid xml

Has anyone overcome this problem? I could write simple string encoder 
but it surely wouldn't handle entities nicely and wouldn't be as 
performant as some tested OS solution.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl