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

Re: xlink implementation

Subject: Re: xlink implementation
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Wed, 20 Feb 2002 17:14:17 +0200
xlink implementation download
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



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.