xsl-list
[Top] [All Lists]

[xsl] Re: Can we have a <xsl:attribute> inside a <xsl:variable>?

2006-04-14 14:41:03
Stupid question...I never need that...<xsl-valueof>
exists for the same purpose of referring to variables,
and the content will directly become the value of the
variable in a <xsl:variable> tag. Sorry for bothering
you all..

Thanks,
Bharathi

--- bharathi kongara <bharathikongara(_at_)yahoo(_dot_)com>
wrote:

Hey guys,

I've a question: Can we have a <xsl:attribute>
inside
a <xsl:variable>?

I'm trying to do something like this: I've to set a
variable depending on a condition that if $var1 is
null or not. If I can directly set the value of
var1,
that could have been ideal. Since I cannot reassign
another value to the variable after it was
declared/initialized in XSL, I'm trying to do that
with the following workaround. But I'm not sure if I
can use an <xsl:attribute> with in the
<xsl:variable>.
Again if its possible, is there a way that I can
assign the values of $var1 or $var2 to prefix,
because
with the following piece, the variable will be just
assigned the word '$var1' or '$var2'.

<xsl:variable name="prefix">
             <xsl:choose>
                <xsl:when test="$var1">
                    <xsl:attribute
name="select">$var1</xsl:attribute>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:attribute
name="select">$var2</xsl:attribute>        
                </xsl:otherwise>
             </xsl:choose>
</xsl:variable>

Thanks in advance,
Bharathi

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around 
http://mail.yahoo.com 



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Re: Can we have a <xsl:attribute> inside a <xsl:variable>?, bharathi kongara <=