Looping through Iterative section

Avatar

Avatar

Smitha_Reddy

Avatar

Smitha_Reddy

Smitha_Reddy

15-11-2011

Hi All,

I need help in writing the java script for looping through the iterative section.

I have asset table, which has asset name ,desc and cost. Each asset section also has 'asset_include' value which can be 'Y' or 'N'.

The iterative data should display only if the asset_include value is 'Y' . How do I loop through the iterative sction and display only if its 'Y'

Example: I have 3 Iterative sections;

<Assets>

     <asset_name>TV</asset_name>

     <asset_desc>Television</asset_desc>

     <asset_cost>50000</asset_cost>

     <asset_include>Y</asset_include>

</Assets>

<Assets>

     <asset_name>Mobile</asset_name>

     <asset_desc>Mobile</asset_desc>

     <asset_cost>30000</asset_cost>

     <asset_include>Y</asset_include>

</Assets>

<Assets>

     <asset_name>Book</asset_name>

     <asset_desc>Book</asset_desc>

     <asset_cost>100</asset_cost>

     <asset_include>N</asset_include>

</Assets>

Output should display only TV and Mobile but not Book.

Its very urgent can some one help me?

View Entire Topic

Avatar

Avatar

Steve_L_Walker

Avatar

Steve_L_Walker

Steve_L_Walker

16-11-2011

Are you referring to merging data and rendering rows in a table only if asset_include is "Y" OR are you referring to iterating through the XML with script to dynamically render the table only if asset_include is "Y"?

Steve