[Home] [By Thread] [By Date] [Recent Entries]
Hans , The following is your solution I have considered the following XML.. <row> <memotext>abcdefghijklmm....</memotext> <!-- assumption that you have more of the darkonrakt elements and u want to check the memotext text length at every <darkonrakt> node.. --> <darkonrakt> </darkontract> <darkonrakt> </darkontract> <darkonrakt> </darkontract> </row> ( just added the parent element.. ) the xsl to get the Break if the string length exceeds 126 characters would be: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:for-each select="/row/darkonrakt"> <xsl:choose> <xsl:when test="string-length(preceding::memotext)>126"> <!-- or <xsl:when test="string-length(../memotext)>126"> --> <xsl:value-of select="string-length(preceding::memotext)"/> <br></br> </xsl:when> <xsl:otherwise> no break becoz the length of the memo text is <xsl:value-of select="string-length(preceding::memotext)"/> which is less than 126 </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:template> </xsl:stylesheet> This code will output a <br></br> and the string length(just for verification )if the string-length of the memotext is greater that 126 ... if it is less , then it outputs a string "no break because the"+ string-length +" is lesser than 126". Will this serve your purpose??? Vasu From: "Braumüller, Hans" <h.braumueller@xxxxxxxxxxxx> _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



