A friend asked yesterday how he could get the columns from a dataset in Spry. I was sure there was an API for this, but it turns out there isn't. Luckily for me (and maybe not for Adobe), I've got the Spry guys on speed dial so I can bug them directly. Here is what Kin Blas had to say:
You can get the columns for a given row in JS like this:
var row = ds.getCurrentRow();
var colNames = [];
for (colName in row)
colNames.push(colName);
Now keep in mind that because folks aren't always consistent in their XML output (they make attributes optional, sometimes the same elements don't have the same number of elements underneath them, etc ... that a given row may have more or less columns than the one that precedes it.
Thanks Kin! I did mention to him that it would be a good idea to add a formal API for this.