This posting could be entitled ŌThe tree sloth comethĶ and it is inspired
by the spirited and highly instructive exchange between Peter and Wendell.
I would like to introduce the possibity of considering the use case of the
treatment whitespace less globally (stripping or preserving on named
elements) and more locally thorugh the normalise-space function.
I am wondering if then WendellÕs suggestion of multiple passes could then
be invoked. Along with a suggestion from Michael KayÕs XSLT ProgrammersÕ
Reference, i.e. using concat() to add an extra space character at the end
[see page 516, 1st edition; page 550, 2nd edition].
I got to this suggestion by considering PeterÕs focus on leading and
trailing whitespace and how a named templatd could be called that invoked
node tests based on the position of the text nodes and then thinking about
how to provide template instructions for output. And thinking about cases
or the one Kay gives as traditional HTML
<p>Some <i>very</i> traditional HTML</p>
After a first pass of normalizing space with concatentation to add a space
at the end of the produced tokens, a second pass could then strip
whitespace. If I am correct the result would meet PeterÕs request to
remove leading and trailing whitespace without affecting the space between
element and text nodes in mixed content elements.
Better, less slothful minds may be able apraise the possibitis while the
tree hugger trailing apace ambles on leaves shoots eats ...
Francois Lachance, Scholar-at-large
~~~ to be surprised by machines: wistly and sometimes wistfully