Over 10 Million Study Resources Now at Your Fingertips

Download as :
Rating : ⭐⭐⭐⭐⭐
Price : $10.99
Pages: 2

When variable defined the stylesheet level


Chapter 13

Table 13.28





Variable Examples

The xsl:variable is typically used to grab information from the source XML that will be reused repeatedly throughout the stylesheet or to store information. Once you grab the information, you can use it again and again by referencing the variable name with a $ prefix, as in $variable_name. Avariable’s value is set as part of its definition, making it quite different from the variables you use in other programming languages. Those variables must be defined and their value must be changed many times over the life of the programs in which they are found. In this way, variables act like constants.


<xsl:variable name=”row_num” select=”0”/>

XSLT In-Depth 333


The results of this example are shown in Figure 13.3. The first time $row_num is referenced, it takes the value of the stylesheet-level row_num variable because no template-body-level $row_num exists at that point. The second time it is referenced, it takes the value of the attribute “num” of the current row.

How It Works
Login account
Login Your Account
Add to cart
Add to Cart
Make payment
Document download
Download File
PageId: ELID398994
Uploaded by :
Page 1 Preview
when variable defined the stylesheet level
Sell Your Old Documents & Earn Wallet Balance