Re: [xsl] xlink implementation

Subject: Re: [xsl] xlink implementation
From: Peter Davis <pdavis152@xxxxxxxxx>
Date: Wed, 20 Feb 2002 11:53:34 -0800
On Wednesday 20 February 2002 07:14, Oleg Tkachenko wrote:
> 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>

Using modes will make the second template execute when the first template 
executes, and I think he wants to make the second template execute all the 
time.  Try this:

<xsl:template match="item[@xlink:type='simple']">
  <a href="{@xlink:href}">
    <xsl:call-template name="real-item"/>

<xsl:template match="item" name="real-item">

This way real-item is also executed for items that do not have 
@xlink:type='simple', but is still called by the first template.

Peter Davis
They took some of the Van Goghs, most of the jewels, and all of the Chivas!

 XSL-List info and archive:

Current Thread