Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-12 Thread Peterson, Wayne
Thank you everyone for the excellent replies. As someone noticed, my original complaint was that the parser was returning linefeeds at all in the DOM tree. I thought that the Windows cr/lf format was causing this but now understand that this is what it is supposed to do. I received conflicting a

Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-11 Thread Dieter Maurer
"Martin v. Löwis" wrote at 2010-5-11 09:14 +0200: >>> The correct way to parse XML files is as binary data. >> >> Why do you think so? >> >> The default "minidom" parser seems not to expect "\r\n" line endings > >Why do you say that? It expects them just fine, replacing them with \n >line endin

Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-11 Thread Martin v. Löwis
>> The correct way to parse XML files is as binary data. > > Why do you think so? > > The default "minidom" parser seems not to expect "\r\n" line endings Why do you say that? It expects them just fine, replacing them with \n line endings, then inserting those into the DOM tree. Just as it s

Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-10 Thread Stefan Behnel
Bill Kinnersley, 10.05.2010 19:59: - XML files are text files, and should be read as text. Sorry, but the only sane way to read them is as binary data. Passing unicode text to the parser will interfere with the encoding declaration at the beginning. - The XML processor is required to retu

Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-10 Thread Fred Drake
On Mon, May 10, 2010 at 1:59 PM, Bill Kinnersley wrote: > - XML files are text files, and should be read as text. XML files contain encoded text, and must be handled as binary files. -Fred -- Fred L. Drake, Jr. "Chaos is the score upon which reality is written." --Henry Miller _

Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-10 Thread Bill Kinnersley
I am parsing an XML file with Python 2.6.5 minidom in Windows and it is mostly working but minidom seems to have problems dealing with Windows cr/lf characters. It creates an extra textnode that needs to be ignored instead of just returning the xml elements. I have tried different methods of openi

Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-10 Thread Peterson, Wayne
re. Wayne -Original Message- From: Dieter Maurer [mailto:die...@handshake.de] Sent: Sunday, May 09, 2010 11:50 PM To: Peterson, Wayne Cc: xml-sig@python.org Subject: Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf Peterson, Wayne wrote at 2010-5-8 23:43 -0700: >I am

Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-10 Thread Stefan Behnel
Dieter Maurer, 10.05.2010 09:07: Stefan Behnel wrote at 2010-5-10 08:57 +0200: Dieter Maurer, 10.05.2010 07:50: Peterson, Wayne wrote at 2010-5-8 23:43 -0700: I am parsing an XML file with Python 2.6.5 minidom in Windows and it is mostly working but minidom seems to have problems dealing with

Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-10 Thread Dieter Maurer
Stefan Behnel wrote at 2010-5-10 08:57 +0200: >Dieter Maurer, 10.05.2010 07:50: >> Peterson, Wayne wrote at 2010-5-8 23:43 -0700: >>> I am parsing an XML file with Python 2.6.5 minidom in Windows and it is >>> mostly working but minidom seems to have problems dealing with Windows >>> cr/lf characte

Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-09 Thread Stefan Behnel
Dieter Maurer, 10.05.2010 07:50: Peterson, Wayne wrote at 2010-5-8 23:43 -0700: I am parsing an XML file with Python 2.6.5 minidom in Windows and it is mostly working but minidom seems to have problems dealing with Windows cr/lf characters. It creates an extra textnode that needs to be ignored i

Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-09 Thread Dieter Maurer
Peterson, Wayne wrote at 2010-5-8 23:43 -0700: >I am parsing an XML file with Python 2.6.5 minidom in Windows and it is >mostly working but minidom seems to have problems dealing with Windows >cr/lf characters. It creates an extra textnode that needs to be ignored >instead of just returning the xml

Re: [XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-09 Thread Stefan Behnel
Peterson, Wayne, 09.05.2010 08:43: I am parsing an XML file with Python 2.6.5 minidom in Windows and it is mostly working but minidom seems to have problems dealing with Windows cr/lf characters. It creates an extra textnode that needs to be ignored instead of just returning the xml elements. I h

[XML-SIG] Parsing XML file with Minidom has problem with cr/lf

2010-05-08 Thread Peterson, Wayne
I am parsing an XML file with Python 2.6.5 minidom in Windows and it is mostly working but minidom seems to have problems dealing with Windows cr/lf characters. It creates an extra textnode that needs to be ignored instead of just returning the xml elements. I have tried different methods of openin