Package lxml :: Module etree :: Class Resolver

[hide private]
[frames] | no frames]

# Class Resolver

    object --+
             |
            Resolver

Known Subclasses:
  - tests.test_xmlschema.ETreeXMLSchemaTestCase.simple_resolver

This is the base class of all resolvers.

Instance Methods | [hide private]

a new object with type S, a subtype of T

__new__(T, S, ...) |

resolve(self, system_url, public_id, context) Override this method to resolve an external source by `system_url` and `public_id`. |

resolve_empty(self, context) Return an empty input document. |

resolve_file(self, f, context, base_url=None) Return an open file-like object as input document. |

resolve_filename(self, filename, context) Return the name of a parsable file as input document. |

resolve_string(self, string, context, base_url=None) Return a parsable string as input document. |

Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__init__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __new__(T, S, ...)

Returns: a new object with type S, a subtype of T
Overrides: object.__new__

### resolve(self, system_url, public_id, context)

Override this method to resolve an external source by `system_url` and `public_id`. The third argument is an opaque context object.

Return the result of one of the `resolve_*()` methods.

### resolve_empty(self, context)

Return an empty input document.

Pass context as parameter.

### resolve_file(self, f, context, base_url=None)

Return an open file-like object as input document.

Pass open file and context as parameters.

### resolve_filename(self, filename, context)

Return the name of a parsable file as input document.

Pass filename and context as parameters.

### resolve_string(self, string, context, base_url=None)

Return a parsable string as input document.

Pass data string and context as parameters.

You can pass the source URL as 'base_url' keyword.