Have you tried:
a = XML("<circle cx='200' cy='500' r='10' />")
?
On Wednesday, December 26, 2012 11:52:54 AM UTC-7, jonas wrote:
>
> Hi. Is there any way to generate xml svg via controllers? svg can be made
> by using declarative syntax, i.e xml instead of javascript. is it possible
> to return an string containing svg xml and render it in index.html? for
> example, a very simple function, index.py:
>
> def index():
>
> a="<circle cx='200' cy='500' r='10' />"
>
> return a
>
> (assuming that
>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "
> http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="
> http://www.w3.org/1999/xlink" width='800px' height='600px'>
> {{=a}}
> </svg>
>
> is already in place in index.html)
>
> I've tried different ways of returning xml (string,dict and TAG helper
> function) but none works. so, is this approach possible or is it a waste of
> time?
>
--