def write_dict(self, dictionary):
"""Write one record for the specified entity."""
if self.xml_style == self.ELEMENT_CENTRIC:
self.output_stream.write('%s<%s>\n' % (self.indent, self.entity_node))
self.write_iterable_as_elements(dictionary)
self.output_stream.write('%s</%s>\n' % (self.indent, self.entity_node))
else:
self.output_stream.write('%s<%s ' % (self.indent, self.entity_node))
for (name, value) in dictionary.iteritems():
self.output_stream.write('%s=%s ' % (name, saxutils.quoteattr(value)))
self.output_stream.write('/>\n')
评论列表
文章目录