|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: computing an attribut value (newbie's question)
>
> <xsl:if test="./@type='bitmap'">
> <IMG .... src="mybitmaps/test/mmmmm{./@color}.jpg"></IMG>
> <xsl:if>
>
> Why does this work?
Because it's correct!
The {./@color} is an attribute value template, the thing between the curly
braces is an XPath expression which is substituted into the attribute value
at the relevant place.
But don't try this construct anywhere, there are only certain places it can
be used.
>
> Can I use a variable for accomplishing the job like
>
> <xsl:if test="./@type='bitmap'">
> <xsl:if test="./@color="xxx">
> <xsl:variable name="MyCol" select="yyy"/>
> </xsl:if>
Your variable here will be out of scope as soon as you hit the </xsl:if>
You can use variables, but you haven't said what you want to achieve with
them so it's difficult to advise.
Mike Kay
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








