Possible Duplicate:
Producing a new line in XSLT
hello can any one help me how to write code for getting newline ....
Possible Duplicate:
Producing a new line in XSLT
hello can any one help me how to write code for getting newline ....
bro i have tried every thing ....but only newline was not getting for me


i have with this all – praveen 4 hours ago
Try:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="text()" name="wrapLines">
<xsl:param name="pText" select="."/>
<xsl:param name="pNumLines" select="10"/>
<xsl:if test=
"string-length($pText) and $pNumLines > 0">
<xsl:variable name="vLine" select=
"substring-before(concat($pText,'
'), '
')"/>
<Line>
<xsl:value-of select="$vLine"/>
</Line>
<xsl:call-template name="wrapLines">
<xsl:with-param name="pNumLines" select="$pNumLines -1"/>
<xsl:with-param name="pText" select=
"substring-after($pText, '
')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
when this transformation is applied on the following XML document:
<t>
line2
line3
line4
</t>
it correctly finds all occurencies of an NL character and correctly splits the text into separate <Line>
elements:
<Line/>
<Line> line2</Line>
<Line> line3</Line>
<Line> line4</Line>
Are you trying to output a new line or hard return? This will output a new line in the transformed file.
<xsl:text>
</xsl:text>
` element. – Michael Kay Mar 05 '11 at 17:49