2 Replies Latest reply: Nov 19, 2009 8:04 AM by Stuart Haiz RSS

    Limit length of xml string

    Stuart Haiz Community Member

      I am following David Power's excellent DW with CSS, Ajax and PHP book, which is saving me a host of frustration - but would like advice.

       

      I'm adding an xml feed as per pg 625 > and I want to limit the number of words showing in my description to about 10. Below is my code:

       

          <xsl:for-each select="rss/channel/item">
             <xsl:if test="position() &lt;=3">
               <h3><a href="{link}"><xsl:value-of select="title"/></a></h3>
               <p><xsl:value-of select="description" disable-output-escaping="yes"/></p>
             </xsl:if>
           </xsl:for-each>

       

      I have tried adding string-length="10" without getting anywhere and don't know how to do this.