Re: [xml] libxml: testhtml adds empty lines add begin/end of paragraphs



On Tue, 2002-09-03 at 00:46, Thomas Hoffmann wrote:
I tried some of the latest versions of libxml (2.4.20, 2.4.23) under
OS/2 and noted that (e.g.) testhtml adds empty lines in paragraphs, so

      <body><p>
      A line
      </p></body>

becomes 

      <body><p>

      A line

      </p></body>

and this becomes 

      <body><p>


      A line


      </p></body>

..... and so on.

If I use the --push option, this does not happen.

To be more precise: OS/2 uses DOSish (x0Dx0A) line endings. The added
empty lines are only 0xD,
so (pseudo-hex) "<p>x0Dx0AA linex0Dx0A</p>" becomes "<p>x0Dx0Dx0AA
linex0Dx0Dx0A</p>", so it is kind of a multiplication of x0Ds (the third
output has x0Dx0Dx0Dx0A at begin and end).

Can anybody give me a hint what could be the reason for this behavior
and where in the code I should start with (further) debugging?


Could it be that the input is read in binary mode, so \r\n comes in as
two separate characters, but output gets written in text mode and then
at each output \n gets converted \r\n ?

IIRC, the mode is specified at open time by second char (
open(file,"rb"), open fileout,"wb") )

-----------------
Hannu






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]