blob: fa5e8cd499937d9b2c906ad5682aca4636770f3f [file] [log] [blame]
Fred Drakee85c3502000-06-29 19:28:01 +00001"""Core XML support for Python.
2
Fredrik Lundh7e0aef02005-12-12 18:54:55 +00003This package contains four sub-packages:
Fred Drakee85c3502000-06-29 19:28:01 +00004
5dom -- The W3C Document Object Model. This supports DOM Level 1 +
6 Namespaces.
7
Fred Drake327e1872000-08-01 00:05:16 +00008parsers -- Python wrappers for XML parsers (currently only supports Expat).
Fred Drakee85c3502000-06-29 19:28:01 +00009
10sax -- The Simple API for XML, developed by XML-Dev, led by David
Fred Drake16f63292000-10-23 18:09:50 +000011 Megginson and ported to Python by Lars Marius Garshol. This
Paul Prescod73678da2000-07-01 04:58:47 +000012 supports the SAX 2 API.
Fredrik Lundh7e0aef02005-12-12 18:54:55 +000013
14etree -- The ElementTree XML library. This is a subset of the full
15 ElementTree XML release.
16
Fred Drakee85c3502000-06-29 19:28:01 +000017"""
Fred Drake327e1872000-08-01 00:05:16 +000018
19
Fredrik Lundh7e0aef02005-12-12 18:54:55 +000020__all__ = ["dom", "parsers", "sax", "etree"]
Fred Drakeaf574312000-09-25 17:30:17 +000021
Martin v. Löwisc9494ac2001-03-27 08:42:12 +000022# When being checked-out without options, this has the form
23# "<dollar>Revision: x.y </dollar>"
24# When exported using -kv, it is "x.y".
Martin v. Löwis764dad52001-03-27 21:38:15 +000025__version__ = "$Revision$".split()[-2:][0]
Fred Drakeaf574312000-09-25 17:30:17 +000026
27
Martin v. Löwis4b9059b2004-10-13 19:57:14 +000028_MINIMUM_XMLPLUS_VERSION = (0, 8, 4)
Fred Drakeaf574312000-09-25 17:30:17 +000029
Thomas Wouters0e3f5912006-08-11 14:57:12 +000030
Fred Drake57500172000-08-04 03:14:55 +000031try:
32 import _xmlplus
33except ImportError:
Thomas Wouters0e3f5912006-08-11 14:57:12 +000034 pass
Fred Drake57500172000-08-04 03:14:55 +000035else:
Fred Drakeaf574312000-09-25 17:30:17 +000036 try:
37 v = _xmlplus.version_info
38 except AttributeError:
Walter Dörwaldf7f9b6c2004-11-25 12:23:23 +000039 # _xmlplus is too old; ignore it
Fred Drakeaf574312000-09-25 17:30:17 +000040 pass
41 else:
42 if v >= _MINIMUM_XMLPLUS_VERSION:
Thomas Wouters0e3f5912006-08-11 14:57:12 +000043 import sys
44 _xmlplus.__path__.extend(__path__)
Fred Drakeaf574312000-09-25 17:30:17 +000045 sys.modules[__name__] = _xmlplus
46 else:
47 del v