Home | Top | ← | → | Overview | Module | Class | Index | Help |
|
About |
---|
|
||||
XML resource reader based on ElementTree and urllib.
:param source: a string containing the XML document or file path or an URL or a file like object or an ElementTree or an Element. :param base_url: is an optional base URL, used for the normalization of relative paths when the URL of the resource can't be obtained from the source argument. :param defuse: set the usage of SafeXMLParser for XML data. Can be 'always', 'remote' or 'never'. Default is 'remote' that uses the defusedxml only when loading remote data. :param timeout: the timeout in seconds for the connection attempt in case of remote data. :param lazy: if set to `False` the source is fully loaded into and processed from memory. Default is `True`.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Method Details |
The XML tree root Element.
|
The ElementTree document, `None` if the instance is lazy or is not created from another document or from an URL.
|
The XML text source, `None` if it's not available.
|
The source URL, `None` if the instance is created from an Element tree or from a string.
|
The base URL for completing relative locations.
|
The namespace of the XML document.
|
Defuse an XML source, raising an `ElementTree.ParseError` if the source contains entity definitions or remote entity loading. :param source: a filename or file object containing XML data.
|
An equivalent of *ElementTree.parse()* that can protect from XML entities attacks. When protection is applied XML data are loaded and defused before building the ElementTree instance. :param source: a filename or file object containing XML data. :returns: an ElementTree instance.
|
An equivalent of *ElementTree.iterparse()* that can protect from XML entities attacks. When protection is applied the iterator yields pure-Python Element instances. :param source: a filename or file object containing XML data. :param events: a list of events to report back. If omitted, only âendâ events are reported.
|
An equivalent of *ElementTree.fromstring()* that can protect from XML entities attacks. :param text: a string containing XML data. :returns: the root Element instance.
|
Resource copy method. Change init parameters with keyword arguments.
|
Loads the XML text from the data source. If the data source is an Element the source XML text can't be retrieved.
|
Extracts namespaces with related prefixes from the XML resource. If a duplicate prefix declaration is encountered then adds the namespace using a different prefix, but only in the case if the namespace URI is not already mapped by another prefix. :return: A dictionary for mapping namespace prefixes to full URI.
|
Returns a list of schema location hints. The locations are normalized using the base URL of the instance. The *locations* argument can be a dictionary or a list of namespace resources, that are inserted before the schema location hints extracted from the XML resource.
|
Home | Top | ← | → | Overview | Module | Class | Index | Help |
|
About |
---|
Copyright(C) 2019 Arno-Can Uestuensoez @Ingenieurbuero Arno-Can Uestuensoez | https://arnocan.wordpress.com |
Generated by Epydoc 4.0.4 / Python-3.8 / fedora27 on Fri Dec 13 15:25:25 2019 | http://epydoc.sourceforge.net |