This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xlink implementation
- From: Oleg Tkachenko <olegt at multiconn dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 20 Feb 2002 17:14:17 +0200
- Subject: Re: [xsl] xlink implementation
- Organization: Multiconn International
- References: <001701c1ba1c$10b96280$050aa8c0@team.imge.ru>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Slava Sedov wrote:
> <xsl:template match="item[@xlink:type='simple']">
> <a><xsl:attribute name="href"><xsl:value-of
> select="@xlink:href"/></xsl:attribute><xsl:value-of select="."/></a>
> </xsl:template>
Why not just
<a href="{@xlink:href}"><xsl:value-of select="."/></a>
>
> It work fine. But now assume that "item" replaced to more abstract tissue as
> "node()" and <xsl:value-of select="."/> turned into <xsl:apply-templates
> select="."/>. As result - stack overflow (first template call itself because
> it have higher priority). Is here exist elegant way to solve this task?
You can explicitly assign priority to a template, but I think more safe
and robust approach will be using modes:
<xsl:template match="item[@xlink:type='simple']">
<a href="{@xlink:href}">
<xsl:apply-templates select="." mode="proccess-me-again"/>
</a>
</xsl:template>
<xsl:template match="item" mode="proccess-me-again">
...
</xsl:template>
--
Oleg Tkachenko
Multiconn International, Israel
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list