|Chapter 18 - Ten Most Confusing Things About XSLT|
|XSLT For Dummies|
|by Richard Wagner|
|Hungry Minds 2002|
You need to think about several factors as you consider whitespace in your result document, because whitespace has origins in both your XSLT stylesheet and the underlying XML source document.
Inside the XSLT stylesheet, whitespace is usually stripped out of the template before any transformation occurs. However, whitespace is preserved in the following cases:
Whitespace inside the source XML document follows similar rules, except that you can declare default whitespace rules by using the xsl: preserve-space or xsl: strip-space instructions. Therefore, any text node that occurs inside the range of xsl:preserve-space is preserved.
See Chapter 13 for more details on whitespace.