| Author |
Alternative way of breaking a loop, when condition met
|
Kumar Raja
Ranch Hand
Joined: Mar 18, 2010
Posts: 457
|
|
Hello All,
I have googled and found that there is no way to break from a loop, when a condition is met. But I need some other workaround for my problem.
My problem statement is as follows,
I have a source XML like below
Now, I need to generate a report in a tabular structure, where it should display something like
The above structure is to be displayed in a <td> element, only if for each <errorassociation>, there are atleast one <errorid>. But should not display anything if no <errorid> element is found or the worst if it has <errorid/>.
How can I attain this?
|
Regards
KumarRaja
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8147
|
|
Kumar Raja wrote:Hello All,
I have googled and found that there is no way to break from a loop, when a condition is met.
What kind of loop?
Kumar Raja wrote:
My problem statement is as follows,
I have a source XML like below
...
Now, I need to generate a report in a tabular structure, where it should display something like
...
The above structure is to be displayed in a <td> element, only if for each <errorassociation>, there are atleast one <errorid>. But should not display anything if no <errorid> element is found or the worst if it has <errorid/>.
How can I attain this?
What does your current code look like? Post the relevant part of that code.
|
[My Blog] [JavaRanch Journal]
|
 |
 |
|
|
subject: Alternative way of breaking a loop, when condition met
|
|
|