In general, you really shouldn't be attempting to insert elements as text.
You may sometimes get away with it, but it'll fail if you ever try to use
the transformation's output directly rather than going through a serialized
text representation, and of course it breaks namespace awareness.

Better solution is to build a real XML fragment, with a genuine <br/>
element at the desired location. Here's a recursive template that should do
the trick, and do so without requiring any extension functions.

CAVEAT: UNTESTED.

<xsl:template name="br-replace">
  <xsl:param name="word"/>
  <xsl:value-of select='substring-before($word,"&#xA;")'/>
  <br/>
  <xsl:call-template name="br-replace">
    <xsl:with-param name="word", select='substring-after($word,"&#xA;")'/>
  </xsl:call-template>
</xsl:template>

______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish
(http://www.ovff.org/pegasus/songs/threes-rev-11.html)

Reply via email to