your are missing the point
the whole problem is the formatting- and styling of the all different options,
your solution is more readable, glens is more better since your way will out put the same id for "my object" and "MyOpject"
or the use of special characters. the only problem is the swatches and comments
so my hack will just add a class to each swath while leaving the attribImag in its place, so styling will be more versatile.
the empty divs is a Small do do, and it will be eliminated since its no longer needed, the clearer is a bigger problem because its necessary if you use image swathes; but is laying in the way if you do not need a swath, and will be inserted again and again and again
the application of a specific class to each option or attrib-swatch is a good start.
just think of a js mouseOver function to swap a image while on that div, the possibilities are endless if you can pin-point each to its own let alone the styling ability that is not possible w/o this hack



