Exemplo n.º 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
Exemplo n.º 2
0
def load(url):
  dl = download(url)
  try:
    return simplejson.loads(dl)
  except:
    return xml2dict.fromstring(dl)
Exemplo n.º 3
0
def load_xml(url):
  return xml2dict.fromstring(download(url))
Exemplo n.º 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)
Exemplo n.º 5
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)
Exemplo n.º 6
0
def load(url):
  dl = download(url)
  try:
    return simplejson.loads(dl)
  except:
    return xml2dict.fromstring(dl)
Exemplo n.º 7
0
def load_xml(url):
  return xml2dict.fromstring(download(url))