CVS: Products/ParsedXML - ManageableDOM.py:1.106 ParsedXML.py:1.42

Martijn Faassen <[email protected]> Thu, 16 May 2002 18:13:31 -0400
Newsgroups gmane.comp.web.zope.parsed-xml
Message-ID <[email protected]>
Update of /cvs-repository/Products/ParsedXML
In directory cvs.zope.org:/tmp/cvs-serv7859

Modified Files:
	ManageableDOM.py ParsedXML.py 
Log Message:
Removed ParsedXML's Expat in favor of PyXML's.


=== Products/ParsedXML/ManageableDOM.py 1.105 => 1.106 ===
 """
 
-#from OFS.SimpleItem import SimpleItem
 import Globals
 import Acquisition
 import App.Management
@@ -100,7 +99,7 @@
 import ExtraDOM
 
 import string
-import Expat
+from xml.parsers import pyexpat
 
 import xml.dom
 import types
@@ -129,7 +128,11 @@
         doc = self._persistentDoc._earlyAqChain()
         path = doc.getPhysicalPath()
         # then get path to node and attach it to that path steps
-        return path + (registry.create_path(doc, self, 'child'),)
+        nodepath = registry.create_path(doc, self, 'child')
+        if nodepath:
+            return path + (nodepath,)
+        else:
+            return path
 
     def getNodePath(self, scheme_name):
         """Create a node path for this node.
@@ -475,7 +478,7 @@
         text=StringIO(data)
         try:
             newNode = self.parseXML(text) # self not in doc if this succeeds
-        except Expat.pyexpat.error, e:
+        except pyexpat.error, e:
             get_transaction().abort()
             if REQUEST:
                 dataOut = self.makeErrorOutput(data, e.offset, e.lineno)
@@ -498,7 +501,7 @@
         "Parse the given file and handle the result."
         try:
             newNode = self.parseXML(file)
-        except Expat.pyexpat.error, e:
+        except pyexpat.error, e:
             get_transaction().abort()
             if REQUEST:
                 file.seek(0)


=== Products/ParsedXML/ParsedXML.py 1.41 => 1.42 ===
      theDOMImplementation
 from StrIO import StringIO
-import Expat
+from xml.parsers import pyexpat
 import DOM, ExtraDOM
 
 from types import FileType, StringType
@@ -119,7 +119,7 @@
         file ='<?xml version = "1.0"?><emptydocumentElement/>'
     try:
         ob = ParsedXML(id, file, useNamespaces, contentType)
-    except Expat.pyexpat.error, e:
+    except pyexpat.error, e:
         if REQUEST is not None:
             err = "%s%s" % (parserr, '<font color="red">%s</font>'
                             % getattr(e, 'args', ''))