This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Read the data only once.
- From: Dimitre Novatchev <dnovatchev at yahoo dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 9 Apr 2002 00:39:41 -0700 (PDT)
- Subject: [xsl] Re: Read the data only once.
- Reply-to: xsl-list at lists dot mulberrytech dot com
> In my xsl I have a global varaible which caluculates and holds
> some data.
A variable cannot calculate data. You probably meant something else.
> I am using that variable from all over the xsl. I am making calls to
> named templates while creating the variable. Each time I call the
> varialbe,
A variable cannot be called -- it is just referenced.
> that named templates are being called to extract the value.
How do you know that? This is the first time somebody mentions that an
XSLT processor will re-evaluate a global xsl:variable every time it's
being referenced. Could some of the XSLT processors developers say if
this is meaningful at all?
> I need a different behaviour here. In my case that variable remains
> constant through out the xsl. So I want to calculate the variable
> only once. Is there a easy way to implement this.
In case the xsl:variable is really declared globally (it is a child of
the xsl:stylesheet element), then there's no reason why it should be
continuously re-evaluated.
If what you describe is true, it sounds extremely strange. Probably you
didn't describe the problem precisely enough? Which XSLT processor are
you using?
Cheers,
Dimitre Novatchev.
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list