Re: How to specify "coupled" attibutes

Perhaps the confusion here is about terminology.  More or less in keeping 
with the precedent of XML 1.0 and DTDs, XML Schema uses the term "content 
model" in a very specific way, which is to refer to the combinations of 
sequences, choices and all groups provided by the language.  From that 
point of view, the new assertion facility is completely separate. 

In other respects the two are quite symmetric in their affect on 
validation:  to be valid per a type, the content must satisfy both the 
"content model" in the sense given above, and the assertions.  The only 
asymmetry I'm aware of is that the XPath 2.0 expressions used in the 
assertions can depend in some cases on the types (such as integer) of the 
elements and attributes tested, and those types are typically assigned and 
tested as a byproduct of content model validation.    If your XPath 
doesn't rely on such type assignment, then content models and assertions 
contribute pretty much symmetrically.

As to helping out an editor, it's usually the case that it is easier to 
infer information from simpler languages, and the regular expressions that 
underly schema content models are in that sense quite simple.  If I say 
choice(a,b,c) it's indeed easy for an editor to know to prompt for an a, 
b, or c.  Then again, nothing prohibits an editor from recognizing certain 
simple XPath expressions you might use in an assertion check and doing 
very similar prompting.  Indeed, I'd expect many assertions to be quite 
simple, such as @a > @b, and I wouldn't be surprised that it would be 
quite easy for a schema-directed editor to help you enter an a that's 
greater than b.

Finally, Michael Kay is right in my opinion:  XPath is a declarative 
language.  It is neither imperative nor Turing-complete.  If these 
subject's are of concern, you might also be interested in reading the 
TAG's finding called the Rule of Least Power [1], which was written by Tim 
Berners-Lee with a little editorial help from me.

Noah

[1] http://www.w3.org/2001/tag/doc/leastPower.html

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------

Received on Wednesday, 17 October 2007 02:14:03 UTC