xsl-list
[Top] [All Lists]

Re: How to call a template that can generate a file name from an element

2004-01-14 10:29:37
Oops don't I feel like a heel.  After reading more of
the list and looking at some other samples I realized
I was making it too hard.  I just switched to:
  <xsl:template name="createBaseFrameFileName">
    <xsl:value-of select="concat($outputDir,
        $fileSep, @name, '_index', '.html')"/>
  </xsl:template>
 
And calling it thus:
  <xsl:variable name="generatedName">
    <xsl:call-template 
          name="createBaseFrameFileName"/>
  </xsl:variable>

At the moment it does not look like I will have to
pass another element to this method (other than the
context) but what if I do?  Since passing the element
as a parameter and then using '$element[(_at_)name]' did
not work is there another way?

Thanks,

Ian

--- Ian Lang <ianplang(_at_)yahoo(_dot_)com> wrote:
<snip>
  <xsl:template name="createBaseFrameFileName">
    <xsl:param name="element"/>
    
    <xsl:value-of select="$element[(_at_)name]"/>
 <!--    <xsl:value-of select="concat($outputDir,
$fileSep, $element[(_at_)name], '_index', '.html')"/> -->
  </xsl:template>

  <!-- Generate the top level html file which sets
up
the frames -->
  <xsl:template match="cabinet|content"
mode="CreateBaseFrame">
    <xsl:param name="title"/>
    <xsl:param name="generator" select="'Our
Generator'"/>
    <xsl:param name="description" select="''"/>
    <xsl:param name="keywords" select="''"/>

    <xsl:variable name="generatedName">
      <xsl:call-template
name="createBaseFrameFileName">
        <xsl:with-param name="element"
select="."/>
      </xsl:call-template>
    </xsl:variable>
<snip>

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list