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

Re: news

Subject: Re: news
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 20 Feb 2001 11:26:27 +0000
Re:  news
Hi Dylan,

> As Jeni described, you could declare it in your template with a
> special default value that indicates it hasn't been set by the
> importing/including transformation (I believe you would have use a
> param rather than a variable to achieve this affect). I'm not saying
> that a run-time test for variables/params is a major omission from
> XSLT, just pointing out that there is a hypothetical use case for
> such a feature.

I actually meant declare it as a global variable in your stylesheet,
so that it is overridden if it is declared as a global variable in the
importing stylesheet.  If you define it within the *template* (even as
a parameter) then that local definition will override any global one,
even if it's on the importing stylesheet.

So if on my utility stylesheet I do:

<xsl:variable name="my:var"
              select="'a-ridiculous-value-no-one-will-set'" />

<xsl:template name="my:template">
   <xsl:choose>
      <xsl:when test="$my:var = 'a-ridiculous-value-no-one-will-set'">
         <!-- variable has not been declared in importing stylesheet
              -->
      </xsl:when>
      <xsl:otherwise>
         <!-- variable *has* been declared in importing stylesheet -->
      </xsl:otherwise>
   </xsl:choose>
</xsl:template>

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



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


Current Thread
  • Re: news, (continued)
    • Dylan Walsh - Tue, 20 Feb 2001 05:33:01 -0500 (EST)
      • Jeni Tennison - Tue, 20 Feb 2001 06:55:19 -0500 (EST) <=

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.