It's too late. The imports are resolved when the schema is parsed with xmlschema.xmlSchemaParse() in XMLSchema.__init__(). The code has a comment that explains what is going on:
# calling xmlSchemaParse on a schema with imports or
# includes will cause libxml2 to create an internal
# context for parsing, so push an implied context to route
# resolve requests to the document's parser __GLOBAL_PARSER_CONTEXT.pushImpliedContextFromParser(doc._parser) self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt) __GLOBAL_PARSER_CONTEXT.popImpliedContext()
You have to disable network access right within the implied context. I have attached a script with a minimal test case.
It's too late. The imports are resolved when the schema is parsed with xmlschema. xmlSchemaParse( ) in XMLSchema. __init_ _(). The code has a comment that explains what is going on:
# calling xmlSchemaParse on a schema with imports or
__GLOBAL_ PARSER_ CONTEXT. pushImpliedCont extFromParser( doc._parser)
self. _c_schema = xmlschema. xmlSchemaParse( parser_ ctxt)
__GLOBAL_ PARSER_ CONTEXT. popImpliedConte xt()
# includes will cause libxml2 to create an internal
# context for parsing, so push an implied context to route
# resolve requests to the document's parser
You have to disable network access right within the implied context. I have attached a script with a minimal test case.