Re: [xml] newline in xmlTextWriter on win32



On Thu, Aug 12, 2004 at 02:35:12PM -0500, Michael Culbertson wrote:
Hello,

On Wed, 11 Aug 2004, Igor Zlatkovic wrote:
This conversion done by the C runtime has been deactivated in libxml on
purpose. The problem was that under some bizarre conditions,
xmlParseFile() followed by a xmlSaveFile() modified the data. It
replaced every \n with \r\n, even if it allready was a \r\n, ending up
with \r\r\n. One did the read-write again and it became \r\r\r\n.

Hmm.. this is interesting since according to XML specification (as was
pointed out recently in an other message on this list), xmlParseFile()
should have converted all \r\n sequences in the input file to \n.  Then,
when the file was output through xmlSaveFile() the C library would convert
all of the single \n characters to the \r\n sequence.

  This should not by default. It is an XML serializer. The behaviour of the
library should be consistent across platforms, and you have no way to know
wether the input was \r\n , \n, \r, or 0x10; at serialization time. I don't
think making the serializer change its behaviour depending on the platform
is a good idea. If your editor can't recognize what \n in an XML resource
means, then it's a good idea to use a different editor for XML input. It may
also as well break encoding on save and lead you with a not well-formed 
result.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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