From: Sean Russell Date: 2002-06-10T09:39:02+09:00 Subject: RE: ANN: REXML 2.3.5 && 2.2.3 james@rubyxml.com wrote: > None of the above. REXML should not do validation. It should, perhaps, Hmm. Ok. What I meant was that I sort of feel obligated to provide a mechanism by which you can validate XML documents with REXML. The /efficient/ way to do this is report validation errors while parsing; the extensible way to do this is to parse the entire document and then validate the document. Of course, this means that hooking validation into the streaming parsers will be more difficult. Validation issues consume a large part of the XML spec. Personally, I'd be happy to ignore validation altogether -- for REXML to solve most people's needs, it'll need some sort of validation mechanism, though. > Maybe it should pass back the results of validation, and perhaps have a > means for updating the REXML document based on post-validation processing > (e.g., default attributes & values provided by the PSVI ). Ya lost me. > Validation and document manipulation are two different tasks that should > be handled separately, with an option to chain the tasks, or piped the > results of one into the other. Yes, I agree. It is probably easiest, and more OO, to have the validator be separate from the core processor. > On a side note, prior discussion of Ruby & XML seemed to emphasize the > Ruby Way, not (necessarily) the W3C way, to process XML. What's the Ruby > Way of validating XML? Why worry about W3C XML schemas if there's no W3C > XML DOM? The Ruby way of validating XML? That's like asking what's the Ruby Way to process documents. You process whatever documents you need to. You validate whichever way you need to. The question is whether the tool you're using supports the way you need to do your job. If you're a contractor and all of your clients are sending you schemas in W3C XML Schema, and you need to do validation, you'd better find an XML parser that supports W3C XML Schema validation. For me, this boils down to: "Of the users of REXML, what is the schema language that they're most likely going to /need/?" I'm just here to provide solutions, not dictate how you work. With a number of caveats, of course. :-) -- |.. Tell me, I forget. <|> Show me, I remember. /|\ Employ me, I understand. /| - Ancient Chinese proverb |