Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 751
  • Last Modified:

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="http://www.w3.org/1999/XSL/Transform"

<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 Kreidl
Richard Kreidl
1 Solution
put it just before <xsl:template match="*"/>
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

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now