How to replace carriage return or line feeds with <BR>?

I've got the following code sample from EE to replace carriage returns or line feeds with my code, but I'm not sure where the code should go.

<xsl:template match="text()" priority="2">        
          <xsl:call-template name="break"/>
     </xsl:template>
     

     <xsl:template name="break">                        
          <xsl:param name="text" select="."/>
          <xsl:choose>
               <xsl:when test="contains($text, '&#xa;')">
                    <xsl:value-of select="substring-before($text, '&#xa;')"/>
                    <br/>
                    <xsl:call-template name="break">
                         <xsl:with-param name="text" select="substring-after($text, '&#xa;')"/>
                    </xsl:call-template>
               </xsl:when>
               <xsl:otherwise>
                    <xsl:value-of select="$text"/>
               </xsl:otherwise>
          </xsl:choose>
     </xsl:template>

=====================
Where would the above code go in
myy XSL code below:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:output method="html" indent="yes" />

<xsl:template match="/">

<html>
<head>

<style type="text/css">
body {background-color:#f5f5f5}
h1 {text-align:center}
h2 {margin-top:0px;text-align:left;text-decoration:underline;color:red}
h3 {color:#00c;font-size:medium;margin-bottom:0px;margin-top:1ex;text-decoration:underline}
h4 {color:Blue;font-size:medium;text-align:center}
li,h3 {font-weight:bold}
pre {margin-top:0px;font-size:small;wrap}
 

</style>

<title>Daily Operations Status Report</title>
</head>
<body>

<H1>Daily Operations Status Report</H1>

  <xsl:apply-templates select="MSR/Info"/>

</body>
</html>

</xsl:template>

<xsl:template match="Info">


<xsl:choose>
<xsl:when test="(BT30004 !='') or (LASTISA !='') or (SSEC !='') or (SIVU !='') or (CM10009 !='') or (ES00014 !='') or
(LASTSRDY !='') or (LASTSRM1 !='') or (LASTSRM2 !='') or (TNC !='') or (IPI !='') or (RPI !='') or (CMHM !='')
or (EBIS !='') or (MVS !='') or (AutoSys !='') or (NMFN !='') or (CSI !='') or (SB !='') or (STMT !='') or (EOS !='')
or (Virus !='') or (DB !='') or (PRNT !='') or (LNWN !='') or (WKNDPJ !='') or (BCP !='') or (Comment !='')">
<xsl:apply-templates select="TODAY"/>
<H2>Critical Application Cycle End Times</H2>
</xsl:when>
<xsl:otherwise>
<H4>No Current Updates</H4>
</xsl:otherwise>
</xsl:choose>

<xsl:if test="(BT30004 !='') or (LASTISA !='')">
<h3>Critical Path Insurance/ISA</h3>
<xsl:apply-templates select="BT30004"/>
<xsl:apply-templates select="LASTISA"/>
</xsl:if>

<xsl:if test="(SSEC !='') or (SIVU !='')">
<h3>Securities</h3>
<xsl:apply-templates select="SSEC"/>
<xsl:apply-templates select="SIVU"/>
</xsl:if>

<xsl:if test="(CM10009 !='') or (ES00014 !='')">
<h3>Commissions</h3>
<xsl:apply-templates select="CM10009"/>
<xsl:apply-templates select="ES00014"/>
</xsl:if>

<xsl:if test="(LASTSRDY !='') or (LASTSRM1 !='') or (LASTSRM2 !='')">
<h3>Sales</h3>
<xsl:apply-templates select="LASTSRDY"/>
<xsl:apply-templates select="LASTSRM1"/>
<xsl:apply-templates select="LASTSRM2"/>
</xsl:if>

<xsl:if test="(TNC !='') or (IPI !='') or (RPI !='') or (CMHM !='') or (EBIS !='')">
<h3>EBIS/TNC</h3>
<xsl:apply-templates select="EBIS"/>
<xsl:apply-templates select="TNC"/>
<xsl:apply-templates select="IPI"/>
<xsl:apply-templates select="RPI"/>
<xsl:apply-templates select="CMHM"/>
</xsl:if>

<xsl:if test="(NMFN !='No Outages') or (CSI !='No Outages') or (SB !='No Outages') or (STMT !='No Outages')">
<h3>Internet</h3>
<xsl:apply-templates select="NMFN"/>
<xsl:apply-templates select="CSI"/>
<xsl:apply-templates select="SB"/>
<xsl:apply-templates select="STMT"/>
</xsl:if>

<xsl:apply-templates select="MVS"/>
<xsl:apply-templates select="AutoSys"/>
<xsl:apply-templates select="EOS"/>
<xsl:apply-templates select="Virus"/>
<xsl:apply-templates select="DB"/>
<xsl:apply-templates select="PRNT"/>
<xsl:apply-templates select="LNWN"/>
<xsl:apply-templates select="WKNDPJ"/>
<xsl:apply-templates select="BCP"/>
<xsl:apply-templates select="Comment"/>

</xsl:template>

<xsl:template match="TODAY[. != '']">
<h4>Cycle Run Of: <font color="#00008B"><xsl:value-of select="."/></font></h4>
</xsl:template>

<xsl:template match="BT30004[. != '']">
<li>Insurance DataBase ended at: <font color="#00008B"><xsl:value-of select="." /></font></li>
</xsl:template>

<xsl:template match="LASTISA[. != '']">
<li>ISA DataBase ended at: <font color="#00008B"><xsl:value-of select="." /></font></li>
</xsl:template>

<xsl:template match="SSEC[. != '']">
<li>Securities System Extract Cycle <font color="red">(2:30 AM SLA)
</font> ended at: <font color="#00008B"><xsl:value-of select="." /></font></li>
</xsl:template>

<xsl:template match="SIVU[. != '']">
<li>Securities Investment Warehouse Update <font color="red">(6 AM
SLA)</font> ended at: <font color="#00008B"><xsl:value-of select="." /></font></li>
</xsl:template>

<xsl:template match="CM10009[. != '']">
<li>Daily Commissions ended at: <font color="#00008B"><xsl:value-of select="." /></font></li>
</xsl:template>

<xsl:template match="ES00014[. != '']">
<li>Semi-Monthly Commissions ended at: <font color="#00008B"><xsl:value-of select="." /></font></li>
</xsl:template>

<xsl:template match="LASTSRDY[. != '']">
<li>Daily Sales Reporting Cycle ended at: <font color="#00008B"><xsl:value-of select="."/></font></li>
</xsl:template>

<xsl:template match="LASTSRM1[. != '']">
<li>MonthEnd Sales Day1 ended at: <font color="#00008B"><xsl:value-of  
select="."/></font></li>
</xsl:template>

<xsl:template match="LASTSRM2[. != '']">
<li>MonthEnd Sales Day2 ended at: <font color="#00008B"><xsl:value-of  
select="."/></font></li>
</xsl:template>

<xsl:template match="EBIS[. != '']">
EBIS/TNC Data Mart Load status: <font color="#00008B"><xsl:value-of  
select="."/></font>
</xsl:template>

<xsl:template match="TNC[. != '']">
<li>TNC/Client Information <font color="red">(7am SLA) </font> ended at: <font color="#00008B"><xsl:value-of  
select="."/></font></li>
</xsl:template>

<xsl:template match="IPI[. != '']">
<li>Investment Product Information <font color="red">(8am SLA) </font> ended at: <font color="#00008B"><xsl:value-of  
select="."/></font></li>
</xsl:template>

<xsl:template match="RPI[. != '']">
<li>Risk Product Information <font color="red">(7am SLA) </font> ended at: <font color="#00008B"><xsl:value-of  
select="."/></font></li>
</xsl:template>

<xsl:template match="CMHM[. != '']">
<li>Contact Management Historical Mart ended at: <font color="#00008B"><xsl:value-of  
select="."/></font></li>
</xsl:template>


<xsl:template match="MVS[. != '']">
<h3>MVS JobsTabled</h3><pre><xsl:value-of select="."/></pre>
</xsl:template>

<xsl:template match="AutoSys[. != '']">
<h3>AutoSys Jobs Tabled</h3><pre><xsl:value-of select="."/></pre>
</xsl:template>

<xsl:template match="NMFN[. != '']">
<li>NMFN and the Field Web Sites: <font color="#00008B"><xsl:value-of select="."/></font></li>
</xsl:template>

<xsl:template match="CSI[. != '']">
<li>CSI: <font color="#00008B"><xsl:value-of select="."/></font></li>
</xsl:template>

<xsl:template match="SB[. != '']">
<li>SiteBuilder: <font color="#00008B"><xsl:value-of select="."/></font></li>
</xsl:template>

<xsl:template match="STMT[. != '']">
<li>Statements: <font color="#00008B"><xsl:value-of select="."/></font></li>
</xsl:template>

<xsl:template match="EOS[. != '']">
<h3>EOS Availability</h3><div><xsl:value-of select="."/></div>
</xsl:template>

<xsl:template match="Virus[. != '']">
<h3>Virus Alerts</h3><div><xsl:value-of select="."/></div>
</xsl:template>

<xsl:template match="DB[. != '']">
<h3>DataBase Availability</h3><div><xsl:value-of select="."/></div>
</xsl:template>

<xsl:template match="PRNT[. != '']">
<h3>Outstanding Printing/Bursting</h3><div><xsl:value-of select="."/></div>
</xsl:template>

<xsl:template match="LNWN[. != '']">
<h3>LAN/WAN Availability</h3><div><xsl:value-of select="."/></div>
</xsl:template>

<xsl:template match="WKNDPJ[. != '']">
<h3>Weekend Projects</h3><div><xsl:value-of select="."/></div>
</xsl:template>

<xsl:template match="BCP[. != '']">
<h3>BCP Status Updates</h3><div><xsl:value-of select="."/></div>
</xsl:template>

<xsl:template match="Comment[. != '']">
<h3>Comments</h3><span><xsl:value-of select="."/></span>
</xsl:template>

<xsl:template match="*"/>
</xsl:stylesheet>

Thanks

LVL 2
Richard KreidlSoftware DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ramazanyichCommented:
put it just before <xsl:template match="*"/>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Carl TawnSystems and Integration DeveloperCommented:
It doesn't matter where you put it, just as long as it is outside of any other <xsl:template>'s
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.