Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: aspdnsf:StripHtml() does not strip out  

  1. #1
    TimMapes is offline Junior Member
    Join Date
    Feb 2009
    Posts
    12

    Default aspdnsf:StripHtml() does not strip out  

    aspdnsf:StripHtml() does not seem to strip out everything this " " is still left in the description text string and is breaking my Pinterest and FB postings

    <xsl:param name="pDes" select="aspdnsf:StripHtml(aspdnsf:GetMLValue(Descr iption))"></xsl:param>

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    StripHTML removes HTML tags, that's all. It uses a regex to find things like <whatever> or </whatever> and removes those.

    If you have specific characters or strings you want to remove from something, a string filter or double translate is usually the way to go.

  3. #3
    AspDotNetStorefront Staff - Lindsay is offline Junior Member
    Join Date
    Jun 2012
    Location
    Ashland, OR
    Posts
    7

    Default Also Something to try...

    This will strip out common data that breaks feeds, and can be called after the StripHtml() method. Call the template and pass in the field you want the data cleaned up with:

    Code:
    	
    <xsl:call-template name="cleanData">
    	<xsl:with-param select="Description" name="data" />
    </xsl:call-template>
    And the template:
    Code:
    <xsl:template name="cleanData">
    	<xsl:param name="data"/>
    	<xsl:param name="data2">
    	    <xsl:value-of select="aspdnsf:GetMLValue($data)" />
    	</xsl:param>
    	<xsl:param name="data3">
    	    <xsl:value-of select="aspdnsf:StrReplace($data2, '|', '')" />
    	</xsl:param>
    	<xsl:param name="data4">
    	     <xsl:value-of select="aspdnsf:StrReplace($data3, '\n', '')" />
    	</xsl:param>
    	<xsl:param name="data5">
    	     <xsl:value-of select="aspdnsf:StrReplace($data4, '&#xA;', '')" />
    	</xsl:param>
    	<xsl:param name="data6">
    		<xsl:value-of select="aspdnsf:StrReplace($data5, '&#xD;', '')" />
    	</xsl:param>
    	<xsl:param name="data7">
    		<xsl:value-of select="aspdnsf:StripHtml($data6)" />
    	</xsl:param>
    	<xsl:value-of select="$data7" />
    </xsl:template>