XML SAX parser bug?

"Martin v. Löwis" martin at v.loewis.de
Thu Jan 19 14:25:54 EST 2006

mitsura at skynet.be wrote:
> but how do I detect that the parser has split up the characters? I gues
> I need to detect it in order to reconstruct the complete string

Don't try to detect it. Instead, assume it always happens, and collect
the strings in characters(), rather than processing them. Do something
like this

   def startElement(self, ...):
       self.chardata = ""

   def characters(self, data):
       self.chardata += data

   def endElement(self, ...):

This is simplified - you might have to deal with nested elements,


More information about the Python-list mailing list