I have been writing code to translate numbers from one format (e.g. "February 13, 1995") to another (e.g. 1995-02-13) and then printing the result twice, once inside an attribute value and once as the content of an element. This does not seem to be very easy with plain XSL. The two problems I have is (1) I don't see how to return the converted number in a value so I can use it more than once. The obvious is not to return a value but instead print it at the place it is calculated. Unfortunately I have to pass the place I want it printed around and this looks rather ugly. I may have missed a way to user define functions here? (2) I cannot change the values of variables so I can't use IFs to generate stuff I will use later. The example <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> <xsl:output format='text'/> <xsl:template match='/'> <xsl:variable name='x' select='43'/> <xsl:if test='1=1'> <xsl:variable name='x' select='23'/> <xsl:text>x set to 23; </xsl:text> </xsl:if> <xsl:text>x is </xsl:text> <xsl:value-of select='$x'/> </xsl:template> </xsl:stylesheet> prints 'x is 43' at the end - this seems to be what the standard wants, but it is not very useful. This is true, if you use XT - Sablotron on the other hand will report an error when it hits the second definition of x. Any way I cannot use <xsl:variable> to change the value of a variable - only to define a new one. Am I missing something here? It appears to me that XSL may not be well suited for algorithmic tasks - my date converting script has gotten very long and complex and I am not too happy with this. The only sulution appears to write the date conversion code (or other similar stuff) in another language and pass it as an external function to Sablotron. This has the disadvantage that I would then like to use Python (possibly first writing some Python extension that allows me to use Sablotron this way) and thus make my code incompatible to other people's who prefer Java (or even Perl.....) -- Guenter Radestock, Universitaetsbibliothek Karlsruhe [EMAIL PROTECTED] http://www.ubka.uni-karlsruhe.de/~guenter
