- From: Jeff Rafter <jeffrafter@defined.net>
- Date: Fri, 10 Jan 2003 08:20:54 -0600
- To: "Jeni Tennison" <jeni@jenitennison.com>
- Cc: <xmlschema-dev@w3.org>
Hi Jeni, > The Particle Emptiable constraint mainly comes into play when checking > whether a particular derivation by restriction is OK and, as you point > out, when checking whether it's legal to specify the default value for > an element (it's only legal if the type of the element is simple or if > it's mixed and emptiable). Actually, I was a little confused on the mixed default value, I had misread it initially and it does apply only to the default value as you point out. I was thinking it applied to the whole of the mixed complexType declaration. > None of this (as far as I can tell) makes any difference to whether a > recursive standalone type definition is legal or not, so I don't think > that Particle Emptiable comes into play here. I may have missed > something though. I could be horribly confused (<confession type="admitting to being away from XML Schemas for a while"/>) but I thought by the following logic it was needed: Section §3.9 (http://www.w3.org/TR/xmlschema-1/#cParticles) specifies the details for Particles. Element declarations are Particles and do "contribute to the definition of content models". With that established (though I don't think it was in dispute : )) I jump down to §3.9.6 Constraints on Particle Schema Components (http://www.w3.org/TR/xmlschema-1/#coss-particle) where it says: "All particles (see Particles (§3.9)) must satisfy the following constraints" Then we get a list of Particle constraints that include Particle Correct, rules for extension and restriction (which reference other rules), Ocurrence Range OK, more derivation rules, and finally Particle Emptiable. I think that the rule is intended to apply to all particles not just derivations (though it is additionally referenced there). It functions similarly to the Occurence Range OK rule-- which is also sandwiched in a strange spot-- but is implemented by several XML Schema editors/validators. I think the rec is saying "All particles...(among other things)... must be emptiable". Of course, because the rule is last and after all of the derivation rules, the rec could be interpretted to imply that it is only useful in those cases. In any event, it is a minor rule-- even if it is broken, an instance document could never be created to satisfy the schema (as you pointed out) so the schema author would discover the problem, eventually. The reason I bring it up really is my own curiousity, really, as I am not positive either way... I tried the latest IBM SQC and it did not catch the error, but it did catch an Occurence Range OK error. Cheers, Jeff Rafter Defined Systems http://www.defined.net XML Development and Developer Web Hosting
Received on Friday, 10 January 2003 09:14:18 UTC