Logo Search packages:      
Sourcecode: zope-attachmentfield version File versions  Download package

def AttachmentField::ooconverter::oo_to_html::parseImages (   self,
  html 
)

parses all images out of the xml code

Definition at line 306 of file ooconverter.py.

00306                                :
        """
        parses all images out of the xml code
        """
      
        matches={}

        # create xpath context
        doc=libxml2.parseDoc(html)
        ctxt=doc.xpathNewContext()
                                                                                               
        # get all img tags
        res=ctxt.xpathEval("//img")
        for img in res:
            try:
                width=float(img.prop('width'))
                height=float(img.prop('height'))
                matches[img.prop('src')]=(width, height)
            except:
                # most probably a linked image
                # this is not supported
                pass

        # cleanup
        doc.freeDoc()
        ctxt.xpathFreeContext()

        return matches


    def parseText(self, text):


Generated by  Doxygen 1.6.0   Back to index