Re: xml.sax problem: getting parse() to read a string

2006-06-05 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > as mentioned in the documentation, and implied by my answer, parseString > is a helper function in the xml.sax module, not a parser method. try doing > > xml.sax.parseString(string, handler) > > instead of that make_parser/setContentHandler/parse dance. > > Thanks a

Re: xml.sax problem: getting parse() to read a string

2006-06-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > 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? as me

Re: xml.sax problem: getting parse() to read a string

2006-06-05 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > if you want to parse a string, use xml.sax.parseString instead of > xml.sax.parse. > > My function has changed to the following (parseString call instead of parse): def parseMessage(self, message): #create a XML parser parser = make_parser() #c

Re: xml.sax problem: getting parse() to read a string

2006-06-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > So in recap, it looks like it is trying to take my string argument as a > file handler. How can I get around this? if you want to parse a string, use xml.sax.parseString instead of xml.sax.parse. -- http://mail.python.org/mailman/listinfo/python-list

xml.sax problem: getting parse() to read a string

2006-06-05 Thread [EMAIL PROTECTED]
Hey all, I recently came across the xml.sax libraries and am trying to use them. I am currently making a string variable, and am attempting to pass it into a parser instance as follows: def parseMessage(self, message): #create a XML parser parser = make_parser() #cre