Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • trfletch 598 posts 604 karma points
    Apr 29, 2010 @ 11:50
    trfletch
    0

      shown on page when HTML is stripped

    Hi,

    I have the following XSLT running on an Umbraco V4 page which is supposed to show a 200 word preview from a node, I have set it to strip out any HTML but it appears that if it is trying to show something that has two spaces next to each other then one of them shows as  

    I have even tried using replace to replace the   with nothing but that does not seem to work. Can anyone tell me why this is happening or what I can do to stop it?

    This is a cut down version of my XSLT:

    <xsl:template name="displayResults">      

    <xsl:variable name="jobdescription" select="umbraco.library:StripHtml(data [@alias='jobdescription'])" />
        <xsl:variable name="jobdescriptionstripped" select="umbraco.library:TruncateString($jobdescription,200,'')" />   

       
      <p><xsl:value-of select="umbraco.library:Replace($jobdescriptionstripped, '&nbsp;', '')"/></p>
          
        

    </xsl:template>
  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Apr 29, 2010 @ 11:58
    Chriztian Steinmeier
    0

    Hi trfletch,

    You should try disabling the output-escaping:

    <p><xsl:value-of select="umbraco.library:Replace($jobdescriptionstripped, ' ', '')" disable-output-escaping="yes" /></p>

    /Chriztian

  • trfletch 598 posts 604 karma points
    Apr 29, 2010 @ 12:12
    trfletch
    0

    Thanks Chriztian,

    Exactly what I needed, I have used disable output escaping before, not sure why I didn't think to use it here. Thanks again.

Please Sign in or register to post replies

Write your reply to:

Draft