[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: xsl:variable
Subject: Re: xsl:variable From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 10 May 2000 15:32:11 +0100 (BST) |
<xsl:template match="/"> <xsl:variable name="global"/> <!-- Other tag --> </xsl:template> Is it correct? Is the variable empty? It is syntactically correct, but strange. If you define it like that then a) the variable is only usable in that one template rather than in all of them as it would have been if you had put the xsl:variable outside the template and b) It has value a result tree template that just has a root node. Thus acts in almost all contexts like the empty string. An XSL variable never changes its value once it is bound so this is not very useful definition for $global. <xsl:template match="pb"> <xsl:variable name="global"> <xsl:value-of select="$global"/> This is again correct put again strange. You have defined another variable (also called global) that is local to this template, and again defined it to be empty. Another question why the <div> and </div> are not in the variable global Because you defined the variable to be empty. You quoted my suggestion of defining it to be > <xsl:variable name="global"> > <xsl:value-of select="/the/first/node/you/want"/> > <xsl:value-of select="/the/second/node/you/want"/> > <xsl:value-of select="/the/third/node/you/want"/> > </xsl:variable> but you didn't put this declaration at the top level of your stylesheet, and you didn't change those xpaths to select whatever it is you want to select. David XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: xsl:variable, Sydney | Thread | Re: xsl:variable, Sydney |
RE: Outstanding Argument!, Medina, Edward | Date | RE: Outstanding Argument!, Medina, Edward |
Month |
Keywords