[Python-checkins] CVS: python/dist/src/Lib/xml/dom pulldom.py,1.5,1.6
Lars Marius Garshol
python-dev@python.org
Sun, 24 Sep 2000 11:31:42 -0700
Update of /cvsroot/python/python/dist/src/Lib/xml/dom
In directory slayer.i.sourceforge.net:/tmp/cvs-serv11310
Modified Files:
pulldom.py
Log Message:
Updated to new SAX method signatures (*NS, patch 101573).
Index: pulldom.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xml/dom/pulldom.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** pulldom.py 2000/09/24 05:21:58 1.5
--- pulldom.py 2000/09/24 18:31:37 1.6
***************
*** 2,6 ****
import xml.sax
! #todo: SAX2/namespace handling
START_ELEMENT = "START_ELEMENT"
--- 2,6 ----
import xml.sax
! #todo: namespace handling
START_ELEMENT = "START_ELEMENT"
***************
*** 20,30 ****
def setDocumentLocator(self, locator): pass
! def startElement(self, name, tagName, attrs):
if not hasattr(self, "curNode"):
# FIXME: hack!
self.startDocument()
! node = self.document.createElement(tagName) #FIXME namespaces!
! for attr in attrs.keys():
node.setAttribute(attr, attrs[attr])
--- 20,30 ----
def setDocumentLocator(self, locator): pass
! def startElement(self, name, attrs):
if not hasattr(self, "curNode"):
# FIXME: hack!
self.startDocument()
! node = self.document.createElement(name)
! for (attr, value) in attrs.items():
node.setAttribute(attr, attrs[attr])
***************
*** 35,44 ****
node.previousSibling.nextSibling = node
self.curNode = node
! # FIXME: do I have to screen namespace attributes
self.lastEvent[1] = [(START_ELEMENT, node), None]
self.lastEvent = self.lastEvent[1]
#self.events.append((START_ELEMENT, node))
! def endElement(self, name, tagName):
node = self.curNode
self.lastEvent[1] = [(END_ELEMENT, node), None]
--- 35,44 ----
node.previousSibling.nextSibling = node
self.curNode = node
!
self.lastEvent[1] = [(START_ELEMENT, node), None]
self.lastEvent = self.lastEvent[1]
#self.events.append((START_ELEMENT, node))
! def endElement(self, name):
node = self.curNode
self.lastEvent[1] = [(END_ELEMENT, node), None]