Re: [xsl] variable declaration

Subject: Re: [xsl] variable declaration
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Mon, 29 Apr 2002 11:01:44 -0400
[Michael Earls]

> 2) The use of the <xsl:attribute/> element allows us to contain more
> than a simple literal.  What if the value of the text field was the
> result of an applied template?  The shortcut would not work in this
> case.  Speaking of case, what if the value was the result of an
> <xsl:choose/> structure?  Same problem.
>

I usually prefer to use attribute value templates even in cases like this.
I like to make the desired value into a variable, then use that variable in
an attribute value template.  This practice makes clear what the intended
output is.  But (for me) it all depends on how complex the xslt fragment
would be - something fairly simple can still be reasonably readable and so I
might embed it as you say.  The more complicated, the more I want to create
a variable for it, then use the variable.  This can also make it easier to
debug the fragment on its own.

Cheers,

Tom P


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


Current Thread