From: Trans Date: 2007-11-27T01:37:59+09:00 Subject: How to map XML attributes I'm working on a DSL that maps XML <=> Object, and I'm stuck on where to store tag attributes. Do attributes belong to the tag or to the content? For example: HTML Content In mapping this to an object, lets say: foo.bar #=> "HTML Content" Does is make sense to ask: foo.bar.attributes #=> { 'xmlns'=>..., 'type'=>... } or should the attributes be tied to the "attributation" of foo, so: foo.attributes(:bar) #=> { 'xmlns'=>..., 'type'=>... } The 'type' attribute makes me think the first makes the most sense, but the 'xmlns' makes me think the later. Any insights? Thanks, T.