How do I get a new line in xslt that appears in the text as well as the html format on the Blackbary handset?

advertisements

Below is my xslt format -

    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="text" indent="yes" />
      <xsl:template match="/">
      <xsl:for-each select="CallXML">
      Added by Vinserve do not delete this line. %$ <xsl:value-of select="sCallID"/> $%

      Dear <xsl:value-of select="sMailTo"/> ,

      <xsl:text>

    </xsl:text>

      <xsl:value-of select="sCommentBy"/>  added a comment to call made by  <xsl:value-of select="sCallOwner"/>.
        <xsl:text>
    </xsl:text>

      Comments:   On( <xsl:value-of select="sCommentDate"/>)
        <xsl:text>
    </xsl:text>
        --------------------------------------------------------
        <xsl:text>
    </xsl:text>

        <xsl:value-of select="sComment"/>
        <xsl:text>
    </xsl:text>

    Original Call Details
    <xsl:text>
    </xsl:text>
        ----------------------
        <xsl:text>
    </xsl:text>

  <xsl:value-of select="sCallSub"/> , <xsl:value-of select="sCallDate"/> , <xsl:value-of select="sCallType"/> , <xsl:value-of select="sCallOption"/>
    <xsl:text>
</xsl:text>

    Party:  <xsl:value-of select="sPrimaryParty"/>
            <xsl:text>
        </xsl:text>
          </xsl:for-each>
             </xsl:template>
        </xsl:stylesheet>

i have used <xsl:text></xsl:text> tag for new line character. I don't want to use <br> or any html tags for new line character. My output will be seen in html or text format. I even tried to use &#10 and such other characters for new line. but it did not give me any results. I am not understanding the exact problem that why i am not getting the new line. Could anyone please help me with this?

thanks.


To add a line break to the XSLT output, it is usually best to use <xsl:text> with a character entity: <xsl:text>
</xsl:text>
But this won't "work" for HTML documents even though it does output a newline to the source.

HTML specification defines that all whitespace should be collapsed. This means that all newlines and tab characters are converted to a space character and all subsequent spaces are converted to one space. How this is done, depends on the HTML viewer application. Therefore, in HTML, the only way to show a forced line break to user is to use <br> element. However, <br> is not a general line break symbol for all XML languages so <br> will be shown as a line break only in (X)HTML documents.