Changeset 263

Show
Ignore:
Timestamp:
03/06/06 17:06:36
Author:
johnsa
Message:

added search and replace template to public skin to restore line breaks with <br/> tags

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/deployment/webpublic/webapp/resources/demoskins/default/default/default.xsl

    r262 r263  
    583583        <td class="fieldname">Description:</td> 
    584584        <td colspan="2" class="fieldval description"> 
    585           <xsl:value-of select="description"/> 
     585          <!--<xsl:value-of select="description"/>--> 
     586          <xsl:variable name="lineBreaks"><br/></xsl:variable> 
     587          <xsl:call-template name="replace"> 
     588            <xsl:with-param name="string" select="description"/> 
     589            <xsl:with-param name="pattern" select="'&#xA;'"/> 
     590            <xsl:with-param name="replacement" select="$lineBreaks"/> 
     591          </xsl:call-template> 
    586592        </td> 
    587593      </tr> 
     
    10621068  </xsl:template> 
    10631069 
     1070  <!--==== UTILITY TEMPLATES ====--> 
     1071 
     1072  <!-- search and replace template taken from 
     1073       http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html --> 
     1074  <xsl:template name="replace"> 
     1075    <xsl:param name="string" select="''"/> 
     1076    <xsl:param name="pattern" select="''"/> 
     1077    <xsl:param name="replacement" select="''"/> 
     1078    <xsl:choose> 
     1079      <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)"> 
     1080        <xsl:value-of select="substring-before($string, $pattern)"/> 
     1081        <xsl:copy-of select="$replacement"/> 
     1082        <xsl:call-template name="replace"> 
     1083          <xsl:with-param name="string" select="substring-after($string, $pattern)"/> 
     1084          <xsl:with-param name="pattern" select="$pattern"/> 
     1085          <xsl:with-param name="replacement" select="$replacement"/> 
     1086        </xsl:call-template> 
     1087      </xsl:when> 
     1088      <xsl:otherwise> 
     1089        <xsl:value-of select="$string"/> 
     1090      </xsl:otherwise> 
     1091    </xsl:choose> 
     1092  </xsl:template> 
     1093 
    10641094  <!--==== FOOTER ====--> 
    10651095