Re: [xml] final output filtering?



Hi Daniel, All,

Without being canonical, I want to provide an observation in this
line ending issue:

When reading with the default file reader

#if defined(WIN32) || defined (__CYGWIN__)
      fd = fopen(path, "rb");
#else
        fd = fopen(path, "r");
#endif /* WIN32 */

libxml2 disables platform dependant line break processing 
by the C runtime under WIN32. Perhaps this should be done for
Mac as well?

When writing with the default file reader

       fd = fopen(path, "w");

platform dependant line break processing (at least on WIN32)
will be delegated to the C runtime library.

I don't know zilch about the Mac platform, but let assume for the
sake of argument that it works like WIN32 and fopen without
"b" will do platform dependant line break processing.

Then, if I'm not mistaken, libxml2 will output with local line
break conventions and everything will work fine, unless you want
to produce under WIN32 a file with Mac conventions or the like.

On the other hand, as libxml2 output already will give different
files, whether run on WIN32 or not, it seems not to be outruled
by principal reasons, to do the output line break conversion
in libxml2 instead of by the C runtime.

Something like xmlSetOutputLineBreakSeparator. Of course
it will add some more complications, but I see no reason
not to accept a patch from Chris on this issue.

Regards,
Peter Jacobi





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