Many thanks, Vasile. The dict in my post is returned by my_app/my_controller/my_function and is used by the view I have developed. Only when people want to download them as a XML file, these spaces start to introduce troubles. If I convert these spaces to underscores in my controller, I will need to add the reverse conversion logic in the view file. I am hoping that this conversion will be done only when they will be rendered as a XML file.
Anyway, I will use your suggestion as a last resort. On Thu, Jun 14, 2012 at 1:54 PM, Vasile Ermicioi <[email protected]> wrote: > d2 = {} > for k,v in your_dict.iteritems(): > d2[k.replace(' ','_')]=v > > #then convert d2 to xml >

