From: james@... Date: 2002-06-10T14:23:34+09:00 Subject: RE: ANN: REXML 2.3.5 && 2.2.3 > 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. Are there validation schemes that require the entire document be in memory before validation can occur? How many schemes allow for validation while token parsing? I'm just wondering how much more efficient it is to validate while parsing, if the parser is otherwise only concerned with balanced angle braces and nested tags. > > 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. Why do you say that? My admittedly distorted view of things suggests that validation is desirable in only a small number of cases. > > > 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. I mean that something like a DTD can define implied attributes and values, so a document instance can omit them; the validation process adds them. My DTD can specify that element 'foo' always has to have a 'bar' attribute, and if foo shows up in the instance document *without* bar, then the parser must behave as if it were there, with some default value. Not sure how REXML would do this, though simply adding it to the instance doc would perhaps be easiest. Then there's the Post Schema Validation Infoset, which takes this idea further. > For me, this boils down to: "Of the > users of REXML, what is the schema language that they're most > likely going to /need/?" Well, for me, it's none. > I'm just here to provide solutions, not dictate how > you work. Still, given a hammer, everything starts to look like a nail. W3C Schemas look a bit like a solution in search of a problem. Perhaps too many database people thinking, "well, if we ever get around to using XML, we're going to need certain things ..." Or vendors realizing that they'll sell more tools if it gets to hard to roll your own. James