From: Jim Menard Date: 2001-11-28T23:53:00+09:00 Subject: [ruby-talk:26807] Re: OASIS test change suggestion TAKAHASHI Masayoshi writes: > Hi, > > Jim Menard wrote: > > I would like to suggest a change in the OASIS test script. > > > > Instead of sending a String containing XML to each parser, please send a > > File object. This way, the parser can follow external references to other > > files. If you slurp the XML into the string and feed NQXML the string, it > > has no way of knowing where the file resides and it can't follow the > > external reference. > > Hmmm... I can change the script. But I think it does not make NQXML > more conformant as non-validating processor, because non-validating > processor does not have to read external entities; it must > read only document entity (but non-validating processor may > read other external entities). As you point out, "does not have to" is different from "is not allowed to". Why not let the XML processors perform as they would like? Aren't "more validating" and "more feature-rich" worthy measurements of an XML processor? > Moreover, IMHO, NQXML (and other parsers) should have something > like: > a) setBase method in XMLParser, and > b) resolveEntity method in SAX's EntityResolver class. > > a) is to set base URI which is not original file's location. > For example, you may parse local file which is got from other > machine by HTTP or FTP. > > #(example I imagine) > parser = NQXML::StreamingParser.new(File.open(file, 'r')) > parser.setBaseURI(other_uri) > parser.each { |entity| > .... What you suggest is legal according to the XML spec: "Unless otherwise provided by information outside the scope of this specification (e.g. a special XML element type defined by a particular DTD, or a processing instruction defined by a particular application specification), relative URIs are relative to the location of the resource within which the entity declaration occurs." ....but I do not think that the feature you suggest should be required, or that it should be necessary to pass the "Maki number" test. > p.s. When NQXML becomes to have conformance with XML 1.0 Rec, > do you rename it 'Quite XML parser'? ;-) I'll worry about that if it happens. Jim -- Jim Menard, jimm@io.com, http://www.io.com/~jimm/ "Don't eat crackers in the bed of your future or you'll get ... scratchy!" -- The Tick