Example #1
0
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
Example #2
0
def load(url):
  dl = download(url)
  try:
    return simplejson.loads(dl)
  except:
    return xml2dict.fromstring(dl)
Example #3
0
def load_xml(url):
  return xml2dict.fromstring(download(url))
Example #4
0
 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)
 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)
Example #6
0
def load(url):
  dl = download(url)
  try:
    return simplejson.loads(dl)
  except:
    return xml2dict.fromstring(dl)
Example #7
0
def load_xml(url):
  return xml2dict.fromstring(download(url))