XML.com: Controlling Whitespace, Part 1

« XML considers four characters to be whitespace: the carriage return, the linefeed, the tab, and the spacebar space. Microsoft operating systems put both a carriage return and a linefeed at the end of each line of a text file, and people usually refer to the combination as the « carriage return ». XSLT stylesheet developers often get frustrated over the whitespace that shows up in their result documents — sometimes there’s more than they wanted, sometimes there’s less, and sometimes it’s in the wrong place. Over the next few columns, we’ll discuss how XML and XSLT treat whitespace to gain a better understanding of what can happen, and we’ll look at some techniques for controlling how an XSLT processor adds whitespace to the result document. »

Tags: