Thank you all very much for your valuable hints!
Abel Braaksma wrote:
You can make this easier by doing it in one pass:
<xsl:analyze-string select="." regex="^\s+|\s+$">
....
Greedy matching (which it is always) will ensure that the
matching-substring is always either the leading or the trailing.
Non-matching-substring is always the middle part.
For completeness, here is the final version of the solution (as far as I
have understood it right):
<xsl:template match="e">
<xsl:analyze-string select="." regex="^\s+|\s+$">
<xsl:matching-substring>
<xsl:value-of select="."/>
</xsl:matching-substring>
<xsl:non-matching-substring>
<e><xsl:value-of select="."/></e>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:template>
It works like a charm!
Yves
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--