[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to call a template that can generate a file na

Subject: Re: How to call a template that can generate a file name from an element
From: Ian Lang <ianplang@xxxxxxxxx>
Date: Sat, 17 Jan 2004 08:38:35 -0800 (PST)
lang sat
Thanks for the help so far.  I still do not see what
is causing my problem.  In the full example I
origonally sent the the template looks like this
(actual file name generation commented out until I can
get just the name to work):
  <xsl:template name="createBaseFrameFileName">
    <xsl:param name="element"/>
    <xsl:value-of select="$element[@name]"/>
 <!--    <xsl:value-of select="concat($outputDir,
$fileSep, $element[@name], '_index', '.html')"/> -->
  </xsl:template>

and it gets used to create a variable like this:
    <xsl:variable name="generatedName">
      <xsl:call-template
name="createBaseFrameFileName">
        <xsl:with-param name="element" select="."/>
      </xsl:call-template>
    </xsl:variable>

I like the idea of using a default for the param
element to use the context node - thanks.  But it
still does not want to pass the context element as a
parameter for some reason.  My select looks like your
example and my XPath expression to get the name looks
good.  I must be missing something!

Thanks,

Ian

-----
David Carlisle <davidc@xxxxxxxxx> wrote
>  Since passing the element
>  as a parameter and then using '$element[@name]' did
>  not work 
>
> If you passed an element as the parameter then 
> $element[@name] would
> work. If it didn't work then presumably you did not
> do that, perhaps you
> passed a string with an element name 
> instead? 'foo'[@name] is not valid Xpath.

----
Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> wrote

At 12:29 PM 1/14/2004, you wrote:
> It will work: we do this all the time. Sometimes 
> it's even recommended to 
> do this even when you don't have to, instead of 
> relying on context 
> implicitly (it's more versatile and clearer for 
> maintenance).
>
> As I said earlier, check whether $element[@name] 
> really gets you what you 
> want, and not something else. $element[@name] is not

> the same as $element/@name. :->


__________________________________
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.