__init__.py 1.13 KB
Newer Older
Fred Drake's avatar
Fred Drake committed
1 2
"""Core XML support for Python.

3
This package contains four sub-packages:
Fred Drake's avatar
Fred Drake committed
4 5 6 7

dom -- The W3C Document Object Model.  This supports DOM Level 1 +
       Namespaces.

8
parsers -- Python wrappers for XML parsers (currently only supports Expat).
Fred Drake's avatar
Fred Drake committed
9 10

sax -- The Simple API for XML, developed by XML-Dev, led by David
11
       Megginson and ported to Python by Lars Marius Garshol.  This
Paul Prescod's avatar
Paul Prescod committed
12
       supports the SAX 2 API.
13 14 15 16

etree -- The ElementTree XML library.  This is a subset of the full
       ElementTree XML release.

Fred Drake's avatar
Fred Drake committed
17
"""
18 19


20
__all__ = ["dom", "parsers", "sax", "etree"]
21

22 23 24
# When being checked-out without options, this has the form
# "<dollar>Revision: x.y </dollar>"
# When exported using -kv, it is "x.y".
Martin v. Löwis's avatar
Martin v. Löwis committed
25
__version__ = "$Revision$".split()[-2:][0]
26 27


28
_MINIMUM_XMLPLUS_VERSION = (0, 8, 4)
29 30


31 32 33 34 35
try:
    import _xmlplus
except ImportError:
    pass
else:
36 37 38
    try:
        v = _xmlplus.version_info
    except AttributeError:
Walter Dörwald's avatar
Walter Dörwald committed
39
        # _xmlplus is too old; ignore it
40 41 42 43
        pass
    else:
        if v >= _MINIMUM_XMLPLUS_VERSION:
            import sys
44
            _xmlplus.__path__.extend(__path__)
45 46 47
            sys.modules[__name__] = _xmlplus
        else:
            del v