Not adding new line in the XSLT

newlinexslt

I am not certain why my xslt won't put a new line in my output…
This is my xslt….

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
  <xsl:output method="text" encoding="iso-8859-1"/>
  <xsl:variable name="newline"></xsl:variable>
  <xsl:template name="FairWarningTransform" match="/">    <!--@* | node()">-->

          <xsl:for-each select="//SelectFairWarningInformationResult">  

                <xsl:value-of select="ApplicationID"/>,<xsl:value-of select="USERID"/>
                &#10;
          </xsl:for-each>

        * Note.  This report outlines Fair warning entries into reported for the above time frame.

      </xsl:template>
</xsl:stylesheet>

Here is my output…

1,TEST1,test2,

I want it to look like…

1,TEST
1,test2,

Why isn't this character
creating a newline

Best Answer

Try replacing

&#10;

with

<xsl:text>&#10;</xsl:text>

That helps XSLT distinguish it from other whitespace in your stylesheet that is part of the stylesheet formatting (not part of the desired output).

Related Topic