logic error in iso draft?
Brian Ewins <[email protected]> Fri, 23 Jul 2004 11:20:59 +0100
| Newsgroups | gmane.text.xml.schematron |
|---|---|
| Message-ID | <[email protected]> |
Something that cropped up in testing... I used a random xml document and a minimal schema and it was reported as valid. Oops. The reason was that no assertions failed, because no rules fired (which was correct for this schema/instance combination), so there were no failed assertions, but no /passed/ assertions either. I checked the draft to see if I'd made a mistake with the semantics, and I can't see it. Should sec 3.4 should be changed from reading: "An instance document is valid if no assertion tests in fired rules of active patterns fail." to "An instance document is valid if no assertion tests in fired rules of active patterns fail and at least one rule fires." ? I can see there might be edge cases where matching 'anything' makes sense, but is this really what we mean by a valid document? Or a 'good' schema, for that matter - since a well-written schema would have picked up that this document wasn't an instance anyway, should a 'good' schema also assert that "for all instance, schema, active-phase combinations, there exists a subject, pattern and rule, (the subject being a member of that instance, the pattern being a member of that schema, the pattern being a member of that active-phase, the rule being a member of that pattern), for which the subject matches the rule.". Along with the schema restrictions that imply a simplified rule contains at least one assert or report, this would be enough to ensure that one assertion would be tested by the schema for all instances and active phases. So: should I report no assertions being tested for an instance as a valid document, an invalid document, or an error? -Baz ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click