Copied to clipboard

Flag this post as spam?

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


  • Kim Grandgagnage 63 posts 87 karma points
    Sep 12, 2011 @ 11:39
    Kim Grandgagnage
    0

    Remove  

    Hi,

    I have an RSS feed for which I need to list the latest news items using xslt.

    I use this syntax:

    <p><xsl:value-of select="umbraco.library:StripHtml(translate(normalize-space(CoditExt:RemoveBetween('&lt;p class=&quot;csharpcode&quot;&gt;&lt;style type=&quot;text/css&quot;&gt;', '&lt;/style&gt;&lt;/p&gt;',./description, 'true', 'true')),'&nbsp;',''))" disable-output-escaping="yes"/>


    With the code line above, the html is stripped and inline styling is stripped. The problem I have is that I can't get rid of the &nbsp; tags in the description. How can I remove these non breaking spaces?

    grts,

    Kim

     

  • Rich Green 2246 posts 4008 karma points
    Sep 12, 2011 @ 12:40
    Rich Green
    0

    Hey Kim,

    I'm not sure I understand exactly what you're trying to do but you can use the built in Umbraco replace as described here http://our.umbraco.org/wiki/reference/umbracolibrary/replace

    You might want to put your first result into a variable and then strip out the &nbsp; something like this

    <xsl:value-ofselect="umbraco.library:Replace($someVariable', '&nbsp;', '')"/>

    Rich

     

  • Rich Green 2246 posts 4008 karma points
    Sep 12, 2011 @ 12:41
    Rich Green
    0

    That should have read (can't edit)

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

    Rich

  • Kim Grandgagnage 63 posts 87 karma points
    Sep 12, 2011 @ 12:43
    Kim Grandgagnage
    0

    Hi Rich,

    I tried the umbraco:library:Replace function, but that didn't solve the problem...the non breaking spaces are still there :s

    grts,

    Kim

  • Rich Green 2246 posts 4008 karma points
    Sep 12, 2011 @ 12:45
    Rich Green
    0

    Ahh, ok, must be something to do with the encoding, sure I've seen something like this before...

    Did you try <xsl:value-of select="umbraco.library:Replace($someVariable', '&amp;nbsp; ', '')"/> instead?

    Rich

  • Kim Grandgagnage 63 posts 87 karma points
    Sep 12, 2011 @ 13:48
    Kim Grandgagnage
    0

    Yes, it solved the problem!! Tnx! :)

Please Sign in or register to post replies

Write your reply to:

Draft