From: paul vudmaska Date: 2003-10-03T07:50:31+09:00 Subject: xml + ruby = happy programmer --- James Britt wrote: > paul vudmaska wrote: > > > > > My point is that that ruby might benefit from an > xml > > type, > > > It already does: String. Nope. > Do you mean special type that defines a (presumably > W3C) XML DOM, > *other* than a REXML Document? Yes! REXML, supporting a quasi / ruby friendly DOM. > See http://www.rubygarden.org/ruby?XMLinRuby > > James Britt Wish i'd seen that thread awhile ago, thank you :-) >>Most peoples' top priority is something like REXML, so it's item #1<< perfect. it works good now but could be closer to ruby. >>What is meant when people refer to "XML"? To me it means a stream of parsable tokens that any xml parser wont die over. The api for getting that data is sorta up in the air but rexml is far better than any i've encountered (heavy on the ms side and some javugly). The rexml site sums this up nicely. >> What exactly is meant by "handle XML out of the box"? << I mean something like this... #(presuming %x creates an xml literal.) x = %x{is your friend} #access it like this... print x.m.l #>is your friend as opposed to x = {'m'=>{'l'=>'is your friend'}} print x['m']['l']#something like that. I'm not a ruby guru and might not even be that good a programmer but i like the first better. Much. >>Will it mean the same thing to XML developers coming to Ruby as it does to Ruby developers looking to work with XML? << Accept the api will be better since it is ruby. It's just another tool. A way to create data structures. Of any type. Coming from both Asp Javascript(which has great xml support but the api is not as awesome as rexml) and PHP, whose xml api you can keep, i was anxious to find a user friendly xml api. And then there was REXML. That and finding e4x, prompted this thread. >>Is there an "XML way"?<< Probably. I hope it can conform to ruby ;) >>Who are the end users?<< ME!Developers, but, subtly, its use brings it closer to users as well, for the same reason templates have gotten so popular. And html for that matter. >>What are the requirements?<< The ruby way or the highway. :) >>What are the time constraints? << REXML is fine and dandy now and for the foreseable future, but strategically, it should be heavily considered, pondered, kicked around, imo. And be ready for production tommorrow. >>[It should] features full XPath << Yes for more sophisticated queries that are not well supported by a simple api. For instance multiple changes of context and subqueries. >>SAX<< ...most helpful(necessary) for heavy sets, if it's that heavy maybe another means would be better than having 2 apis. But maybe not ;) And then there is native Xsl(not really xsl but programic styling of data, http://martinfowler.com/bliki/movingAwayFromXslt.html that hopefully, gleans some of xsl's benefits without its verbosity or syntax). But i'll start that flame war another day. Its been fun. pv __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com