use RSpec.parse_dict() instead of manually updating the root element attributes
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Wed, 26 Oct 2011 17:38:14 +0000 (13:38 -0400)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Wed, 26 Oct 2011 17:38:14 +0000 (13:38 -0400)
sfa/util/record.py

index 420cc6f..54c3f9f 100644 (file)
@@ -302,7 +302,7 @@ class SfaRecord(Row):
         recorddict = self.as_dict()
         filteredDict = dict([(key, val) for (key, val) in recorddict.iteritems() if key in self.fields.keys()])
         record = XML('<record/>')
-        record.root.attrib.update(filteredDict)
+        record.parse_dict(filteredDict)
         str = record.toxml()
         return str