SAX parsing error related to newlines

Jim Kalafut kalafutj1 at yahoo.com
Sat Jan 11 04:59:50 CET 2003


I'm working on a cross-platorm application that relies on a shared XML file
exchanged via FTP.  I'm using the xml.sax modules to parse the file.  I've
noticed that each platform (linux, windows) likes to see the file with that
platform's preferred newline convention.  For example, if the xml file was
last created in linux, the newlines will only have a linefeed character.  If
I try to parse that in windows I invariably get a "junk after document
element" error from SAX.  If, however, I first convert the file's LF to
CR-LF, then it parses just fine.  How do I setup SAX, or the input object,
to disregard the subtle newline differences that exist between tags?

Regards,
Jim







More information about the Python-list mailing list