Dmitri Fedoruk wrote: > def extApplyXslt(xslt, data, logger ): > try: > strXslt = urllib2.urlopen(xslt).read() > # i have to read the xslt url to the python string > except urllib2.HTTPError, e: > ....... > except urllib2.URLError, e: > ............. > try: > xslt_parser = etree.XMLParser() > xslt_parser.resolvers.add( PrefixResolver("XSLT") ) > > # and now I have to use the string; a more elegant solution, > anyone?
Sure, lxml.etree can parse from file-like objects. Just hand in the result of urlopen(). Apart from that, I saw that you found your way to the lxml mailing list, I'll respond over there. Stefan -- http://mail.python.org/mailman/listinfo/python-list