The following XSLT transformation:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
Description: <br />
<xsl:call-template name="multiLineText">
<xsl:with-param name="pText" select="
"/>
</xsl:call-template>
</html>
</xsl:template>
<xsl:template name="multiLineText">
<xsl:param name="pText"/>
<xsl:choose>
<xsl:when test="contains($pText, '
')">
<xsl:value-of select="substring-before($pText,'
')"/>
<br />
<xsl:call-template name="multiLineText">
<xsl:with-param name="pText"
select="substring-after($pText,'
')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$pText"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
when applied on this source xml documet:
<job Title = "Ex1"
Desc =
"Line 1 11111
Line 2 22222
Line 3 33333
"
/>
produces the wanted result:
<html>
Description: <br>Line 1 11111
<br> Line 2 22222
<br> Line 3 33333
<br> </html>
Cheers, Dimitre Novatchev
|