Results 1 to 3 of 3

Thread: aspdnsf:StripHtml() does not strip out  

  1. #1
    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
    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
    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>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •