Re: [docbook-apps] Re: xsl:call-template: misplaced xsl:apply-imports

From
Bob Stayton <>
Date
2007-10-16T21:37:33+00:00
ID
02af01c8103c$b7261e70$6400a8c0@totoro
Thread
Re: [docbook-apps] Re: xsl:call-template: misplaced xsl:apply-imports
Sorry, I lost the thread a bit there.  You could have your special 
"filename" template call the "link" template, but add a new parameter to 
express different behavior. Then you could customize the "link" template to 
accept the new parameter, and behave somewhat differently when it is set.

<xsl:template match="filename[@role = 'module']">
  ...
  <xsl:call-template name="link">
    <xsl:with-param name="linkend" select="@path"/>
    <xsl:with-param name="caller">filename</xsl:with-param>
  </xsl:call-template>
  ...
</xsl:template>

<xsl:template match="link" name="link">
  <xsl:param name="caller" select="''"/>
  ...

  <xsl:choose>
    <xsl:when test="$caller = 'filename'">
    ...


Bob Stayton
Sagehill Enterprises
DocBook Consulting



----- Original Message ----- 
From: "Sam Steingold" <>
To: "Bob Stayton" <>
Cc: <>
Sent: Tuesday, October 16, 2007 1:36 PM
Subject: Re: [docbook-apps] Re: xsl:call-template: misplaced 
xsl:apply-imports


> Bob Stayton wrote:
>> Why not just customize the "link" template itself, then?
>
> I am confused.
> I am trying to have <filename role="module" path="zot">foo</filename>
> treated as if it were <link linkend="zot"><filename 
> role="module">foo</filename></foo>
> how do I customize the "link" template to accomplish that?!
>
> Sam.
>
>