Example 2: Repeating rows conditionally

Top  Previous  Next

This example can be found in page "x_32_RepeatingRichtextTables_2" of project "XSLTechnics".

example2

Note that custom CScript functions "%c()", "%fn()" , "%st()" and "%sum()" ) are used in table to simplify its look. The function definitions inside the dummy element (example2_dummy) as follows.

 

customfunctions

 

The content of the XML file used for preview:

 

<?xml version="1.0" encoding="utf-8"?>

<root>

 <products>

         <item>

                 <ProductName>Chai</ProductName>

                 <UnitPrice>180000</UnitPrice>

                 <UnitsInStock>39</UnitsInStock>

         </item>

         <item>

                 <ProductName>Chang</ProductName>

                 <UnitPrice>190000</UnitPrice>

                 <UnitsInStock>17</UnitsInStock>

         </item>

         <item>

                 <ProductName>Aniseed Syrup</ProductName>

                 <UnitPrice>100000</UnitPrice>

                 <UnitsInStock>13</UnitsInStock>

         </item>

         <!-- .. -->

         <!-- .. -->

         <!-- .. -->

 </products>

</root>

 

The Outcome:

example2_result