[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Recursive substitution

Subject: RE: Recursive substitution
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 11 Mar 1999 19:17:37 -0000
michael 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.