From: Bob Hutchison Date: 2001-11-14T06:13:27+09:00 Subject: [ruby-talk:25075] Re: XML support in the standard lib; what exactly? On 01/11/13 1:41 PM, "Bob Gustafson" wrote: > > ---------------------------------- > > Striking out on a slightly different direction, maybe some discussion of > the 'requirements' of a ruby xml processor would be in order. > > Requirements - i.e., what do you want to do with the XML documents? 0) parse an XML document and generate SAX-like events without having to have the whole document in memory. (I'm getting boring :-) 0.1) parse an XML document and generate a DOM-like structure [I would never use this, personally, but I think others want it]. 0.2) write an XML document using an event-like api. 0.3) write the XML corresponding to the DOM-like structure. > > 1) extract data from certain fields? > > 2) convert documents from one DTD scheme to another? (Abiword -> Docbook?) These are probably both XSLT things. > > 3) quickly create data scraps to send between computers, both having > different database schemas? I think this requires either 0.0/0.2 or 0.1/0.3 from above. Is there more you had in mind? Again, from my admittedly selfish point of view, do 0.0 and 0.2, then 3 will follow naturally. Do 0.1 and 0.3, then 3 will follow almost as naturally :-) > > 4) All of the above? Well, I normally use Java. To run XSLT over some small documents takes about 27 seconds *each* using Xerces (Java XSLT from Apache). Using libxml (C based GNU library) these documents take between 0.3 and 0.6 seconds. This is not because the java translator is poorly written :-) Anyways, 50-100 times faster is so significant that, well, it is like having a different tool. > > 5) All of the above with the same tools or different tools. > > Which of these usages are most important to you folks? Is it ease of use, > completeness with one tool? What? Given that this is Ruby, I'd say ease of use has to rank up there. > > Would several tools (each adapted to a different use) be better than one > mondo tool? Again, this strikes me as being more Ruby-like. > > BobG