From: Bob Hutchison Date: 2001-11-14T02:00:38+09:00 Subject: [ruby-talk:25037] Re: XML support in the standard lib; what exactly? On 01/11/13 11:21 AM, "Tobias Reif" wrote: > Bob Hutchison wrote: > > >>> Other models could declare the sequence of attributes relevant, etc. >>> >> Not in XML, the order of attributes are specifically unordered -- there can >> be no meaning to the order. > > > Where is that specified in the XML spec? How would you specify their order? Anyways, your quote from the infoset makes it pretty clear. > > Anyway, there are differences betweem the three data models I mentioned, > and any difference would be OK to illustrate that. > > >>> IMHO, any RubyWay API should use 'The Document Object Model 's model' as >>> a basis to build its' API on top. This way, it could perhaps use a DOM >>> parser. Or it could adhere to the Infoset. >>> >> As long as you also provide an event model that does NOT require the whole >> tree to be in memory. > > > I don't understand. Currently, we're only talking about a RubyWay tree API. > An eventbased API is something else. > Or do you mean a tree API which doesn't require the whole tree to be in > memory? I think in Python they have something like that; interesting. There are some clever java parsers doing this kind of thing too (I think the first XML parser did something along these lines, but I'm not certain). But this isn't what I was getting at. Again, it is only my opinion, but an event based parser should be a very high priority for Ruby. Without it certain things cannot be done (or rather done remotely efficiently). Specifically, the tool I'm working on (similar to an XML data binding) would be seriously compromised. > > >> The infoset spec defines the information contained in an XML document, it >> does not say how to implement it. > > > That's why it might be a good fit as a base for a new API. > The new API would be based on a data model, defined as such; not on > specifications of APIs that imply some data model. I don't know if it is an API, but if you mean use it to define the information that the Ruby API must provide, then I (tentatively) agree -- certainly it is the minimum requirement. There is a bit of a controversy brewing over the infoset. It may be that an XML document that is 'streamed through an infoset' looses information necessary to reproduce itself. If this is true, there might be a problem basing things on the infoset. > > Tobi > >