Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie need help with nested for loop

 
Tokai Moshai
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know it could be too much to ask for, but I don't know much XSL and need only one thing, do not have to time to learn it as well. So, if someone can give me the code, I will really appreciate that. here is the xml file i need to use

<parent name="name1" group="grp1">
<class name="Style">
<param id="1" good="30" bad="10"/>
<param id="2" good="40" bad="20"/>
<param id="3" good="70" bad="30"/>
<param id="4" good="20" bad="15"/>
<param id="5" good="30" bad="18"/>
<param id="6" good="50" bad="15"/>
<param id="7" good="39" bad="18"/>
</class>
</parent>
<parent name="name2" group="grp1">
<class name="Style">
<param id="1" good="35" bad="14"/>
<param id="2" good="45" bad="23"/>
<param id="3" good="75" bad="36"/>
<param id="4" good="25" bad="15"/>
</class>
</parent>
<parent name="name3" group="grp2">
<class name="Style">
<param id="1" good="34" bad="34" correctable="23"/>
<param id="2" good="34" bad="13" correctable="23"/>
<param id="3" good="78" bad="56" correctable="23"/>
</class>
<class name="other">
<param id="1" good="34" bad="34" correctable="23"/>
<param id="2" good="34" bad="13" correctable="23"/>
<param id="3" good="78" bad="56" correctable="23"/>
<param id="4" good="41" bad="15" correctable="23"/>
<param id="5" good="30" bad="23" correctable="23"/>
</class>
</parent>

what i need is one for loop that will select the name. and then using that name i need another for loop that will go over the params. my problem is right here, i can't seem to use the value i'm getting in parent for loop into the nested for loop.

thanks in advanced.
 
Paul Clapham
Sheriff
Pie
Posts: 20750
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It isn't considered correct to ask people to write code for you here. Generally we prefer to help people solve their own problems rather than doing their work for them.

However in this case, even if we wanted to write your code, you haven't posted anything near to the complete specifications for the code. So I think it would be better if you posted what you have, and explained what you want it to do.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic