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]