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

Re: forwarding only existing parameter

Subject: Re: forwarding only existing parameter
From: Guillaume Rousse <rousse@xxxxxxxxxxxxxx>
Date: Mon, 17 Sep 2001 14:16:47 +0200
graham rousse
Ainsi parlait David Carlisle :
> > I'm trying to forward parameters from a template to another, only if they
> > are defined, in the most simple way.
>
> variables and parameters are always defined in XSLT. If a definition of
> a variable x is not in scope then you can not use $x so there is no
> possibilty of asking if x is defined.
>
> Why can't you just always pass on the value of your parameter?
> by choosing a suitable default value you should be able to determine
> which case you are in in your code.
Cause i have the following structure

<template name="list-item">
  <param name="context">

  <li>
    <apply-template select=".">
      <with-param name="context" select="$context"/>
    <apply-template/>
  </li>
</template>

<template match="specific-item1">
  <param name="context">default value</param>

  [..]
</template>

When calling list-item template with a context parameter, it get forwarded to 
template specific-item1. But when calling list-item template without this 
parameter, it forwards an empty context parameter to template specific-item1, 
thus preventing default value use :-(
-- 
Guillaume Rousse <rousse@xxxxxxxxxxxxxx>
GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html

 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.