|
Subject: RE: [xsl] rewriting xslt 1 to xslt 2.0 From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Mon, 28 Jan 2002 17:46:30 -0000 |
> I have some stylesheets I wrote a long time ago, about 7
> months I guess, and
> I want to update them now to xslt 2.0(it was a stylesheet for
> generating
> further stylesheets) the whole thing is quite gnarly in the
> code so I won't
> reproduce it here.
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"/>&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>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] rewriting xslt 1 to xslt 2.0, Bryan Rasmussen | Thread | RE: [xsl] rewriting xslt 1 to xslt , Bryan Rasmussen |
| [xsl] Difference between import and, Khalid | Date | RE: [xsl] [urgent] XSL output encod, Michael Kay |
| Month |