Fredrik Lundh wrote:
> if you want to parse a string, use xml.sax.parseString instead of
> xml.sax.parse.
>
> </F>
My function has changed to the following (parseString call instead of
parse):
def parseMessage(self, message):
#create a XML parser
parser = make_parser()
#create an instance of our handler class
#generic, prints out to screen on all events
dh = docHandler()
#tell parser to use our handler
parser.setContentHandler(dh)
parser.parseString(message)
return
I am getting the following error.
File "acmtest.py", line 205, in parseMessage
parser.parseString(message)
AttributeError: ExpatParser instance has no attribute 'parseString'
Am I simply missing that library here? Or am I calling it incorrectly?
My import line reads as follows (but I am not sure how to explictly
make sure I have this library)
import socket, select, os, sys, traceback, re
from xml.sax import make_parser, parseString
from xml.sax.handler import ContentHandler
--
lucas
--
http://mail.python.org/mailman/listinfo/python-list