|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Variable declaration
I have just recently started using xml and cant seem to get
my variables to work properly.There is something wrong with my
declaration of the variables myvar1 and myvar2. I do not get any
error messages, but the variables just don't seem to exist when I
try to use them.
This is my stylesheet:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<xsl:variable name="myvar1" select="'content1'"/>
<xsl:variable name="myvar2">content2</xsl:variable>
This is myvar1: <xsl:value-of select="$myvar1"/>, and
this is myvar2: <xsl:value-of select="$myvar2"/>
</xsl:template>
</xsl:stylesheet>
Output in the browser:
----------------------------------------------
content2 This is myvar1: , and this is myvar2:
----------------------------------------------
In the declaration of myvar2, "content2" is printed to the screen,
so it looks like the declaration tags are skipped. And there seems
to be no value stored in myvar1. What am I missing? I have tried
different versions of Internet Explorer and Netscape but that does
not work either.
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








