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

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

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=""

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

<xsl:template match="/">


<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}


<title>Daily Operations Status Report</title>

<H1>Daily Operations Status Report</H1>

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



<xsl:template match="Info">

<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>
<H4>No Current Updates</H4>

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

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

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

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

<xsl:if test="(TNC !='') or (IPI !='') or (RPI !='') or (CMHM !='') or (EBIS !='')">
<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 test="(NMFN !='No Outages') or (CSI !='No Outages') or (SB !='No Outages') or (STMT !='No Outages')">
<xsl:apply-templates select="NMFN"/>
<xsl:apply-templates select="CSI"/>
<xsl:apply-templates select="SB"/>
<xsl:apply-templates select="STMT"/>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<xsl:template match="*"/>


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.

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

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
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.