This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: xlink implementation


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"/>
  </a>
</xsl:template>

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

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:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]