Thanks, Jens, that's the answer.

As I say, I'll probably have more questions about the resolvers in time.


From: Jens Quade <>
Sent: 22 May 2018 23:59:56
To: Duthie, Roger J.A.
Subject: Re: [lxml] Personal problems with resolve_string

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?

> class simple_string_resolver(etree.Resolver):
>     def resolve(self, url, id, context):
>         # pass this byte object to the resolve_string method
>         return etree.Resolver.resolve_string(content, id, context, base_url=url)

according to




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 when naming things (like SimpleStringResolver).


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.