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

RE: rewriting xslt 1 to xslt 2.0

Subject: RE: rewriting xslt 1 to xslt 2.0
From: "Bryan Rasmussen" <bry@xxxxxxxxxx>
Date: Tue, 29 Jan 2002 11:17:39 +0100
stiltext

>The most obvious change you can make is to replace the recursive template
>with an iteration. Something like:
>
>
>
> <xsl:param name="siblings">
> <stil for="def" type="1">dyn</stil>
> <stil for="def" type="2">plain</stil>
> <stil for="dyn" type="1">def</stil>
> <stil for="dyn" type="2">plain</stil>
> <stil for="plain" type="1">def</stil>
> <stil for="plain" type="2">dyn</stil>
> </xsl:param>
> <xsl:variable name="stilnum" select="2"/>
>
> <xsl:template name="changeStyles">
> 	<xsl:variable name="br_type" select="@browse"/>
> 	<xsl:variable name="st_type" select="@style"/>
>   <tempxsl:template match="change_style">
> 	<xsl:variable name="stiltext"
> select="$siblings/stil[@for=$st_type and
> @type=position()]"/>
>
> <xsl:for-each select="1 to $stilnum">

> <br/>
> <a>
>  <tempxsl:attribute name="href"><xsl:value-of
> select="$br"/>assembler.asp?xmlsrc=&mspgl;
>  <tempxsl:value-of select="$title"/>&amp;st=<xsl:value-of
> select="$br"/><xsl:value-of select="$stiltext"/>
> </tempxsl:attribute>
> 		<xsl:call-template name="langstring">
> 			<xsl:with-param name="trans2"
> select="concat($stiltext,'_style')"/>
> 		</xsl:call-template>
> </a>
>
    </xsl:for-each>
  </xsl:template>

thanks, have to stick partially recursive though, because @type=position()
is 1,
<xsl:for-each select="1 to $stilnum"> is especially helpful :)


 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.