New Line in xslt is creating a problem for me. i searched a lot and found many ways of inserting a new line character in xslt. but nothing is working out. I tried using
<xsl:text></xsl:text>, <xsl:text>
</xsl:text>
and many such other new line characters. but failed. I dont wanna use any html characters like <br/>
n all. I just wanna know how will i get a new line in xslt
.Does it depend on the os used, processor, xslt version or anything?
output what i want is:
Dear abc,
You Have received a Mail.
but i am getting it as:
Dear abc, You have received a mail.
i even used
<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:outpu开发者_开发问答t method="text"/>
<xsl:template match="/">
<xsl:text>
 1 
 2 
 </xsl:text>
</xsl:template>
</xsl:stylesheet>
but still it shows 1 2 in one line.
Based on the responses in the comment section the cause of your problem seems to be simply that you created a ".html" result file and then looked at that in a browser which applies HTML display rules where new lines are usually simply collapsed to spaces. So the solution to the problem is to simply ensure you create a ".txt" file instead, that way your new lines will be displayed when looking at the file.
精彩评论