xsl-list
[Top] [All Lists]

Re: [xsl] Removing unwanted space

2021-06-04 17:05:19
On Fri, 2021-06-04 at 21:42 +0000, Peter Flynn peter(_at_)silmaril(_dot_)ie 
wrote:
[...]


Pass all text nodes in mixed content through a template which will
strip
space from the start (if it's the first text node in an element) or
the
end (if it's the last text node in an element) or both (if it occurs
somewhere else in the element.

Watch out for  input like

<p>The boy<em> splshed </em>through the puddles!</p>
and,
<p>It was very un<i>convent</i><b>ion</b>al to have to face a fully-
charged nun.</p>


(I admit i didn't try Peter's template on these cases; however, that 
they are unusual does not make them unumportant).


-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>