nl2elements
This is an open discussion with 2 replies, filed under XSLT.
Search
@bpierre - I was looking for something like this yesterday. Thanks so much for posting.
I was looking for something like this today ;-)
One thing though: You should change line 32 to:
<xsl:choose> <xsl:when test="substring-after($string,' ') != ''"> <xsl:value-of select="substring-after($string,' ')" /> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string" /> </xsl:otherwise> </xsl:choose>
This way, if no linebreak is set in the text, not an empty element would be rendered (which is now the case), but it would just show one single element.
Create an account or sign in to comment.
A new XSLT utility, “nl2elements” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.