Quote:
Originally Posted by eschwartz
It is XML. The spaces don't matter.
whitespace in XML/HTML only matters inside an element, and then it is collapsed down to one space.
|
Not strictly true. In some elements, e.g.
pre, whitespace is preserved. Also, space between inline elements is significant, as is whitespace around comments. (I know this because I was the guy who fixed the bug on that last one in libxml2's HTML parser many years ago.) And with a proper parser, you can add
xml:space="preserve" to any arbitrary element to preserve whitespace within in.
But yes, that's roughly true in the general case.