Thursday, March 03, 2011

Serving XHTML As XML

Serving XHTML As XML

This just bit me in the ass in Django. The trick was to add the correct mimetype to the render:


return render_to_response('recordings/show.html', {
'annotations' : annotations,
'recording_id' : recording_id,
'pitchcontour' : pitchcontour
}, {}, mimetype="application/xhtml+xml")