Commits

Alexander Herrmann  committed 76eee59

resource tag has to be root element for xml input

  • Participants
  • Parent commits 3a2766d

Comments (0)

Files changed (2)

File piston/emitters.py

         xml.endDocument()
 
         return stream.getvalue()
+    
+    @staticmethod
+    def parse_xml(xml):
+        return xml2dict.fromstring(xml)['resources']
 
 Emitter.register('xml', XMLEmitter, 'text/xml; charset=utf-8')
 if xml2dict: # if import was successfull

File piston/xml2dict.py

     a python dictionary.
     """
     xml = ET.fromstring(s)
-    return _parseNode(xml)['resources']
+    return _parseNode(xml)