Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Change a variable after declaration

From: Peter Flynn <peter.nosp@-.--------.-->
To: NULL
Date: 6/3/2006 1:39:00 AM

Jeremy Chapman wrote:
> Aaaarg.  That seems like a pretty bad limitation to me.  

XSLT is a declarative language, not a procedural language.
You need to forget all about procedural methods.

> Are they any work arounds? as I do a for-each I wanted to build 
 > up a variable to use elsewhere in my transform.

There are certainly ways to do this. But don't think in terms
of for-each: there are usually better ways of performing an
operation on a set of data. In XSLT, for-each is only used when
you want to process some set of values out of normal document
sequence, or if you want to process them on several occasions,
or if you want to change their sort order. In normal document
sequence there is an apply-templates operation which causes
specified nodes to be processed.

Look at the XSLT FAQ for "named templates":
http://www.dpawson.co.uk/xsl/sect2/N5280.html

///Peter
-- 
XML FAQ: http://xml.silmaril.ie/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent