Gudge and I just talked about this idea. He pointed out that in W3C-speak a 2nd Edition is just a collection of errata. So this would really be XSD 1.0a. More importantly, he pointed out that xs:anyAttribute already exhibits the desired non-deterministic behavior. That is, when matching an attribute in an instance to a schema declaration, you always match known attributes first, then, if none of them match, you match the attribute wildcard. This is exactly what Noah is proposing should happen for element wildcards.
It's worth noting that simple text values are also non-deterministic. If you have a union of int and string, a given instance of that type in an attribute or element could match either type (everything is a string). The rules for union processing say types are matched in order, so while it's non-deterministic, you know what will happen.
Given that attributes and simple types have the desired behavior, why don't elements? The requirement comes from a desire not to ever have to look ahead beyond the element you're on.
If XSD was modified to do this, it wouldn't break any existing XSD instances (as long as we avoid the other thing Noah proposed - implicit extension points - which would break existing XSDs). XSD validators would have to follow the new rule. Paul Downey commented that he's busy testing a suite of validators to see how many actually implement this rule (which is called UPA) correctly. It may be that many already exhibit the desired behavior Noah proposed! We wouldn't have to change the namespace.
We need to make this happen!
Posted
Oct 21 2004, 04:08 PM
by
tim-ewald