logic error in iso draft?
Brian Ewins <Brian.Ewins <at> btinternet.com>
2004-07-23 10:20:59 GMT
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?
(Continue reading)