Re: [xml] final output filtering?
- From: Justin Fletcher <justin fletcher ntlworld com>
- To: xml gnome org
- Subject: Re: [xml] final output filtering?
- Date: Tue, 10 Jun 2003 17:42:46 +0100 (BST)
On Tue, 10 Jun 2003, Peter Jacobi wrote:
Hi Daniel,
But precisely, I want libxml2 to be platform independant. The exact
same sequence of bytes should come out of it given the same sequence
of bytes in input.
I think there is still confusion here.
First, if you really want to enforce byte-by-byte identical output when
streaming out the tree, the writer's fopen has to be changed to:
#if defined(WIN32) || defined (__CYGWIN__)
fd = fopen(path, "wb");
#else
fd = fopen(path, "w");
#endif /* WIN32 */
I'm probably missing something here, but I would have thought that if you
really wanted to enforce byte-by-byte identical output when streaming to
the tree you should *always* be using :
fd = fopen(path, "wb");
that is, the conditional case seems completely redundant to me. You want
the data to be treated as binary so I would have thought that you would
always want to open it for binary output. Thus avoiding the problem of
line endings on platforms you haven't yet encountered (broken C libraries
not withstanding).
The only issue that I've seen on the list so far (Igor's post) has been a
MS broken C library implementation when plain "w" is used. This is
something which Daniel (and general principles) wants to avoid anyhow, so
why not drop the text mode entirely for all platforms ?
--
Gerph {djf0-.3w6e2w2.226,6q6w2q2,2.3,2m4}
URL: http://www.movspclr.co.uk/
... I shut the door and travelled to another home.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]