From: David Alan Black Date: 2001-11-16T21:04:01+09:00 Subject: [ruby-talk:25411] Re: XML support in the standard lib;whatexactly? Hello -- On Fri, 16 Nov 2001, Nat Pryce wrote: > James Britt wrote: > > I don't think there have been *any* points *against* a "Ruby way" API; > some of the threads, though, seem to suggest that it would be > > the *only* API. > > I've been in favour of Ruby supporting a "native" API and a DOM API, but > thinking about it, this may be a disadvantage for the standard library. The > standard library is a foundation on which to build higher-level > functionality, including other libraries for performing XML processing. If > there are two standard Ruby XML APIs, then an author of an XML library will > write to one of these APIs, and so users of the other API will not be able > to use that library in their applications. > > Fragmentation of a low-level infrastructure libraries disadvantages the Ruby > userbase. As an example, look how the two Ruby unit test frameworks has been > a drawback to users of both Lapidary and RubyUnit. Lapidary users have not > been able to use RubyUnit extensions such as Ruby/Mock, while RubyUnit users > have not been able to use the GUIs written for Lapidary. This will be > sorted out now that Lapidary and RubyUnit are merging into a single > framework that will be part of the standard library. True, though at the same time, if someone wants to write something because they existing software doesn't do what they want (as in the case of Nathaniel and Lapidary, as I understand it), they should. Also, no mattter what is bundled with the Ruby distribution, people will probably go on writing XML parsers and other utilities in Ruby. > So, my opinion is that the standard library should include a streaming > parser and a Rubyesque document API that includes XPath and XSLT, but that a > DOM API should be distributed separately from the standard library. I'm looking at it a little differently, though for some of the same reasons you've brought up. If the core library is supposed to be the foundation on which to build, then perhaps there should be, for example, a Ruby version of the SAX interface, perhaps along with a parser that implements it. That way, future (SAX, in this example) parser writers would have their work planted in the standard distribution. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav