how to update value to global variable in xsl

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<br/>
Below is my sample page of xsl
1. Ist i need to create global variable
2. Each 1st loop variable value need zero
3. In the 2nd loop variable value need product price
4. show that value in each 1st loop finish

<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; output <span style="color:Red; method<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; xml<span style="color:Black; " <span style="color:Red; indent<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; yes<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; variable <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Min_Value<span style="color:Black; " <span style="color:Red; select<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 0<span style="color:Black; "<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; variable<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; template <span style="color:Red; match<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; /<span style="color:Black; "<span style="color:Blue; >

<span style="color:Green; <!--- some staff -->

<span style="color:Blue; <<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; for-each <span style="color:Red; select<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; /products/product<span style="color:Black; "<span style="color:Blue; >

<span style="color:Green; <!--- after each loop here global variable make zero -->

<span style="color:Blue; <<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; variable <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Min_Value<span style="color:Black; " <span style="color:Red; select<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 0<span style="color:Black; "<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; variable<span style="color:Blue; >

<span style="color:Blue; <<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; for-each <span style="color:Red; select<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; list<span style="color:Black; "<span style="color:Blue; >

<span style="color:Green; <!--- some staff -->

<span style="color:Blue; <<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; variable <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Product_Price<span style="color:Black; " <span style="color:Red; select<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 100<span style="color:Black; " <span style="color:Blue; />

<span style="color:Blue; <<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; if <span style="color:Red; test<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $Product_Price > $Min_Price<span style="color:Black; "<span style="color:Blue; >

<span style="color:Green; <!--- if product price comes grater than MinPrice, update variable -->
<span style="color:Blue; <<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; variable <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Min_Price<span style="color:Black; " <span style="color:Red; select<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $Product_Price<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; </<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; if<span style="color:Blue; >

<span style="color:Blue; </<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; for-each<span style="color:Blue; >

<span style="color:Green; <!--- some staff -->

<span style="color:Blue; <<span style="color:#A31515; MinPrice<span style="color:Blue; ><span style="color:Green; <!--- after loop i need to show min price here --><span style="color:Blue; </<span style="color:#A31515; minPrice<span style="color:Blue; >

<span style="color:Blue; </<span style="color:#A31515; xsl<span style="color:Blue; :<span style="color:#A31515; for-each<span style="color:Blue; >
[/code]
<br/>
<br/>





View the full article
 
Back
Top