|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] last index of...
Is there a function in XSLT which obtains the position of the last occurrence of a string within another string? Ive been trying to use creative combinations of string-length(), substring(), substring-before() and substring-after() to get 'nnn' out of 'aaa/bbb/ccc/~~~/nnn.zzz'. specifically im trying to avoid this sort of ordeal.... <xsl:variable name="mainLength" select="string-length(substring-before(name(.),'.'))"/> <xsl:variable name="mainLessFrag" select="substring(name(.),$mainLength+2)"/> <xsl:variable name="secLength" select="string-length(substring-before($mainLessFrag,'.'))"/> <xsl:variable name="secLessFrag" select="substring($mainLessFrag,$secLength+2)"/> <xsl:variable name="main" select="substring-before(name(.),'.')"/> <xsl:variable name="sec" select="substring-before($mainLessFrag,'.')"/> <xsl:variable name="sub"> <xsl:choose> <xsl:when test="$secLessFrag != 'xml'"><xsl:value-of select="substring-before($secLessFrag,'.')"/></xsl:when> <xsl:otherwise><xsl:value-of select="$secLessFrag"/></xsl:otherwise> </xsl:choose> </xsl:variable> which has never sat well with me! thanks! utah oblio jared ingersoll XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








