Re: [lxml] Personal problems with resolve_string

Thanks, Jens, that's the answer. As I say, I'll probably have more questions about the resolvers in time. Rg. ________________________________ From: Jens Quade <jq@qdevelop.de> Sent: 22 May 2018 23:59:56 To: Duthie, Roger J.A. Subject: Re: [lxml] Personal problems with resolve_string Hi, I haven’t worked with the Resolver class, but if you call the method via the class (and not by self.), shouldn’t the first parameter be self?
according to http://lxml.de/1.3/resolvers.html#resolvers self.resolve_string( or etree.Resolver.resolve_string(self, should work. (and do the same, as long as you do not overwrite resolve_string in your simple_string_resolver class.). Also, you may want to follow PEP 8 https://www.python.org/dev/peps/pep-0008/ when naming things (like SimpleStringResolver). best, jens ________________________________ This message (and any attachments) is for the recipient only. NERC is subject to the Freedom of Information Act 2000 and the contents of this email and any reply you make may be disclosed by NERC unless it is exempt from release under the Act. Any material supplied to NERC may be stored in an electronic records management system. ________________________________
participants (1)
-
Duthie, Roger J.A.