Copied to clipboard

Flag this post as spam?

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


  • vaibhav 119 posts 139 karma points
    May 03, 2011 @ 09:24
    vaibhav
    0

    Problem with truncatestring in aslt

    Hi,

    I have this in my xslt

    <div id="newscontentArea">
                  <div id="newscontentHeader"><xsl:value-of select="umbraco.library:ReplaceLineBreaks(contentHeader)" /></div>
                  <div id="newscontentDate"><xsl:value-of select="umbraco.library:ShortDate(@createDate, true(), ' - ')" /></div>
                  <div id="articlecontent"><xsl:value-of select="umbraco.library:TruncateString(umbraco.library:ReplaceLineBreaks(article),72,'')" disable-output-escaping="yes"/>
                      <xsl:if test="string-length(umbraco.library:ReplaceLineBreaks(article) &gt; 72)">  <!-- only show the link if truncated? -->
                           <a href="{umbraco.library:NiceUrl(@id)}">  >> </a>  
                      </xsl:if>
                  </div>
              </div>

    Problem 1 .

    When i see this in browser then i see the <br> tag after & before this

    <div id="articlecontent"><xsl:value-of select="umbraco.library:TruncateString(umbraco.library:ReplaceLineBreaks(article),72,'')" disable-output-escaping="yes"/>

    what to do so that i dont get this <br>

     

     

  • Kim Andersen 1447 posts 2196 karma points MVP
    May 03, 2011 @ 09:40
    Kim Andersen
    0

    Hi vaibhav

    Maybe the 'article' contains some line breaks. Could you try outputting the entire content of article in a textarea like this:

    <textarea>
    <xsl:copy-of select="article" />
    </textarea>

    /Kim A

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    May 07, 2011 @ 12:20
    Jan Skovgaard
    0

    Hi Vaibhav

    Is this online somewhere so we can see the generated output?

    /Jan

  • Kim Andersen 1447 posts 2196 karma points MVP
    May 11, 2011 @ 22:33
    Kim Andersen
    0

    Hi vaibhav

    Did you ever find a solution to this issue? If you did, could you post it in here so we can see what caused the "error".

    /Kim A

  • vaibhav 119 posts 139 karma points
    May 13, 2011 @ 14:15
    vaibhav
    0

    No i dident found the solution for this error......

  • Kim Andersen 1447 posts 2196 karma points MVP
    May 13, 2011 @ 15:08
    Kim Andersen
    0

    Have you tried the textarea-trick that I mentioned in my first answer?

    /Kim A

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies