[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Recursive substitution
> Can anyone suggest a way to re-code the following horrible stylesheet > fragment: > Another way which is perhaps marginally less horrible is to do something like: <xsl:choose> <xsl:when test="/*">$</xsl:when> <xsl:when test="/*/*">$$</xsl:when> <xsl:when test="/*/*/*">$$$</xsl:when> <xsl:when test="/*/*/*/*">$$$$</xsl:when> <xsl:when test="/*/*/*/*/*">$$$$$</xsl:when> <xsl:otherwise>Nesting too deep</xsl:otherwise> </xsl:choose> Haven't tried it though. It might also be worth trying the much cleaner: <xsl:for-each select="ancestor(*)">$</xsl:for-each> But my reading of the spec doesn't convince me that's supposed to work. Mike Kay 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
|