From: Zach Dennis Date: 2003-10-03T23:51:24+09:00 Subject: Re: xml + ruby From: Austin Ziegler Wrote: >I think it's more than that. There's a deep division in the XML camp >itself as to whether things should be expressed as attributes or >child elements: > > > baz > >The moment you have to deal with an attribute, the x.y notation >becomes nearly useless. How do you deal with attributes in that >form[1]? You deal with by accessing foo.attributes["bar"], which will equal baz. You shouldn't access childNodes by saying "foo.bar" This can lead to ambiguity in many cases. Instead each XML object should support something like: If you want to write baz then write something like: foo.childNodes[0] = bar xml object foo.childNodes[0].nodeValue = "baz" >There's further confusion if you had: > > 123 > >How would I refer to each individual item: list.item[0] through >list.item[2]? The structure for the XML object should look something like: list.childNodes[0].nodeValue = "1" list.childNodes[1].nodeValue = "2" list.childNodes[2].nodeValue = "3" For Ruby to have a well structured and defined( and accessible ) XML object is not that far out there. I have a feeling that this XML object may improve from a little bit of XP style thinking. We( or whomever ends up writing it ) should start with a basic XML object that can be expanded upon to add stylesheets, CDATA tags, etc..etc..People only need to use the equivalent of what they have now and a little bit more. And since the XML we have know lacks alot it and alot the ease it shouldn't be this hard to come out with a new or revised XML Object. -Zach