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

RE: news

Subject: RE: news
From: Dylan Walsh <Dylan.Walsh@xxxxxxxxxx>
Date: Tue, 20 Feb 2001 10:25:32 -0000
RE:  news
> From:	Michael Kay [SMTP:mhkay@xxxxxxxxxxxx]
> Sent:	Monday, February 19, 2001 8:44 PM
> To:	xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:	RE:  news
> 
>> >> Can anyone please tell me how to test whether a variable has been
>> defined?
>> >
>> >There is no such test. ...
>>
>> What if the variable may, or may not, be defined as a global
>> variable in a
>> stylesheet which imports or includes the stylesheet you are writing?
>
>It's always known at compile time which variables are in scope, because
>xsl:import and xsl:include can be resolved at compile time. Therefore,
>there's no point in having a run-time test on the existence of a variable,
>any more than there is in C or Java.
>
>Mike Kay

My point was you are writing a transformation that will be included into
other stylesheets, that 
are supposed to set the variable, but perhaps don't. Maybe those stylesheets
are being written
by other people.

As Jeni said "But if you're writing the stylesheet that's being
imported/included,
then you don't know what it's (going to be) imported/included into.  I
think that's what Dylan's talking about."

In Java, you cannot invoke a method or a constructor without providing the
correct number of arguments.

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.


 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.