Sign In/My Account | View Cart  
advertisement

Article:
 Controlling Whitespace, Part 1
Subject: Preserve linefeed
Date: 2006-05-22 21:02:14
From: Bob DuCharme
Response to: Preserve linefeed

I have very little experience with the DOM, but I do know that XML parsers don't care about the difference between \r\n and \n, and trying to get them to care is like trying to get them to care about attribute order. There are good reasons that they don't care (see the XML Recommendation), and to control things like this you need to use something like a perl script that treats the text as a string of bytes and not as XML.


Bob


No Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Titles Only Titles Only Newest First
  • Preserve linefeed
    2008-06-16 05:58:01 Nishant Thorat [Reply]

    The XML parser treats newline sequence in a unique way (replacing newline by a single linefeed). This is to ensure the cross-platform compatibility e.g. in Windows linefeed is represented by linefeed + carriage while in Unix it is represented by linefeed character.


Sponsored By: