W3C home > Mailing lists > Public > www-xsl-fo@w3.org > August 2005

re-apply a template

From: Sam Steingold <sds@gnu.org>
Date: Sat, 27 Aug 2005 18:39:22 -0400
To: www-xsl-fo@w3.org
Message-ID: <uvf1rf1id.fsf@gnu.org>

How do I re-apply a template - without re-processing the whole file again?
e.g., I have
<filename role="unix">stdio.h</filename>

and I want to turn it into a link to the SUS doc:

<xsl:template match="filename[@role='unix']">
 <a class="{@role}" href="{$unix.top}basedefs/{translate(.,'/','')}.html"
    >&lt;<xsl:apply-imports/>&gt;</a>
</xsl:template>

the above works, but "<>" are not formatted as <filename>.

I want something like this:

<xsl:template match="filename[@role='unix']">
 <a class="{@role}" href="{$unix.top}basedefs/{translate(.,'/','')}.html"
  ><xsl:call-template name="filename">&lt;<xsl:value-of select="."/>&gt;</xsl:call-template></a>
</xsl:template>

unfortunately, the default "filename" template does not have a name(?):
runtime error: file common.xsl line 40 element call-template
xsl:call-template : template filename not found

so, what should I do?
(I would rather not process the file twice)

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.iris.org.il> <http://truepeace.org> <http://ffii.org/>
<http://www.openvotingconsortium.org/> <http://www.camera.org>
Trespassers will be shot.  Survivors will be prosecuted.
Received on Sunday, 28 August 2005 03:06:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:13 GMT