[web] cleanup xmlrss view
Don't trigger exceptions unnecessarily, and add line breaks to the
output.
--- a/cubicweb/web/views/xmlrss.py Wed Feb 17 14:01:35 2016 +0100
+++ b/cubicweb/web/views/xmlrss.py Thu Mar 19 21:19:52 2015 +0100
@@ -94,10 +94,8 @@
if value is None:
self.w(u' <%s/>\n' % attr)
else:
- try:
+ if attrschema in SERIALIZERS:
value = SERIALIZERS[attrschema](value)
- except KeyError:
- pass
self.w(u' <%s>%s</%s>\n' % (attr, value, attr))
for relstr in self._cw.list_form_param('relation'):
try:
@@ -175,7 +173,7 @@
val = self._cw.view('final', rset, row=rowindex,
col=colindex, format='text/plain')
w(simple_sgml_tag(tag, val, **attrs))
- w(u' </row>\n')
+ w(u'\n </row>\n')
w(u'</%s>\n' % self.xml_root)