|
From: Will P. <pa...@dc...> - 2002-09-25 10:43:21
|
Hmm... tried the minidom thing (forced it w/ the change
below) -- this is a Python 2.2.1 -- and it worked just fine.
Oh well, keep fishing...
Will
diff -u -1 -r1.30 xmlfile.py
--- xmlfile.py 11 Feb 2002 10:22:05 -0000 1.30
+++ xmlfile.py 25 Sep 2002 10:38:47 -0000
@@ -136,25 +136,33 @@
# since the xml.version_info variable is not a reliable indicator.
- try:
- # Try for a PyXML implementation first, starting with
- # the new-style PyXML first (>= 0.5.6):
- import xml.dom.ext.reader.Sax
- doc = xml.dom.ext.reader.Sax.FromXmlStream(open(filename))
- if ark.control.ArkControl().debug(ark.control.PARSING):
- sys.stderr.write(' (new PyXML)\n')
- except ImportError:
- try:
- # No luck there, so try the old-style PyXML (probably
- # 0.5.5.1):
- import xml.dom.core
- import xml.dom.utils
- doc = xml.dom.utils.FileReader().readFile(filename)
- if ark.control.ArkControl().debug(ark.control.PARSING):
- sys.stderr.write(' (old PyXML)\n')
- except ImportError:
- # Last ditch, do we have a modern Python (>= 2.0) with
- # a minidom implementation:
- import xml.dom.minidom
- doc = xml.dom.minidom.parse( open(filename) )
- if ark.control.ArkControl().debug(ark.control.PARSING):
- sys.stderr.write(' (minidom)\n')
+
+ # Last ditch, do we have a modern Python (>= 2.0) with
+ # a minidom implementation:
+ import xml.dom.minidom
+ doc = xml.dom.minidom.parse( open(filename) )
+ if ark.control.ArkControl().debug(ark.control.PARSING):
+ sys.stderr.write(' (minidom)\n')
+
+# try:
+# # Try for a PyXML implementation first, starting with
+# # the new-style PyXML first (>= 0.5.6):
+# import xml.dom.ext.reader.Sax
+# doc = xml.dom.ext.reader.Sax.FromXmlStream(open(filename))
+# if ark.control.ArkControl().debug(ark.control.PARSING):
+# sys.stderr.write(' (new PyXML)\n')
+# except ImportError:
+# try:
+# # No luck there, so try the old-style PyXML (probably
+# # 0.5.5.1):
+# import xml.dom.core
+# import xml.dom.utils
+# doc = xml.dom.utils.FileReader().readFile(filename)
+# if ark.control.ArkControl().debug(ark.control.PARSING):
+# sys.stderr.write(' (old PyXML)\n')
+# except ImportError:
+# # Last ditch, do we have a modern Python (>= 2.0) with
+# # a minidom implementation:
+# import xml.dom.minidom
+# doc = xml.dom.minidom.parse( open(filename) )
+# if ark.control.ArkControl().debug(ark.control.PARSING):
+# sys.stderr.write(' (minidom)\n')
|