[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:variable
<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
|
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
|