On Fri, 2005-09-23 at 16:54, Martin Holmes wrote:
> Hi there,
> Processing of actual whitespace can be a bit flaky in various XSLT
> processors, and it can be difficult to get the right balance of
> xsl:strip-space and xsl:preserve-space to get the results you want in
> a way that is reliably portable between systems. Where spaces are
> important (as they may often be when you're encoding below the word
> level), I'd suggest encoding the actual spaces, using perhaps a space
> tag or a seg tag. That way you can always ensure they're properly
> described, and properly processed in any output system. It does make
> the code hard to read, but when you're encoding at this level the
> text is usually pretty hard to read anyway.
Unfortunately that is sometimes the only way to do it.
It was IMHO a serious error to make strip-space entirely remove text
nodes consisting of white-space only in mixed content, as this breaks
the model of mixed content. The rule should be to collapse them to a
single space token (I wouldn't fight against the removal of such nodes
where they comprise leading and trailing space, however). I don't
believe the rationale for the way XSLT processors currently implement
this was sufficiently thought out.