def parseXml(ixml, tagName): """ Method to parse the given xml for the given id and return the result as object minidom is used here. @param xml: Xml to parse @param tagName: Tag name to look for in the xml """ doc = xml.dom.minidom.parseString(ixml) if doc: doc = doc.getElementsByTagName(tagName) if doc: return fromstring(doc[0].toxml()) return None
def load(url): dl = download(url) try: return simplejson.loads(dl) except: return xml2dict.fromstring(dl)
def load_xml(url): return xml2dict.fromstring(download(url))
def parsexml(self, xml): """ Method which parses the xml returned by slideshare and returns a list of dict. Interestingly this is JSON representation of slideshare xml. """ return fromstring(xml)