Jacob Kjome wrote:
>I'm wondering if there's a better way to iterate over structured XML? Here's
>how I'm currently doing it...
>
>int i = 0;
>while (true)
>{
> String subset = new
>StringBuffer(18).append("tables.table(").append(i++).append(")").toString();
> SubsetConfiguration sc = (SubsetConfiguration) config.subset(subset);
> if (sc.isEmpty()) break;
>
> //do stuff with subset configuration here....
>}
>
>...which works, but it seems like I should be able to just do an iteration over
>the subconfigurations. Maybe something like this?...
>
>for (Iterator iter = config.getList("tables.table").iterator();
>iter.hasNext();)
>{
> SubsetConfiguration sc = (SubsetConfiguration) iter.next();
>
> //do stuff with subset configuration here....
>}
>
>However, that doesn't work because config.getList() returns a list of string
>contents of the table elements (which returns a list of size 0, since <table>
>elements are only for structure, not for text content). That's not what I'm
>aiming for. Isn't there a way that I can iterate over a list of subset
>configurations so I don't have to resort to generating a dynamic key? This
>would make my code more clean. I hope I'm just missing something.
>
>thanks,
>
>Jake
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
I'm sorry, but there is no integrated, elegant way of iterating over
structured properties ATM. This is something I was already thinking
about, but have not come to a conclusion yet. I am sure this is an often
needed use case.
Maybe something in the line of a functor? I am open to any suggestions...
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]