RE: What good is Restriction?

> 
> We did almost that: we use Schematron as a
> Post-Validation-Schema-Constraint-Checker (PVSCC?). Because 
> derivation by
> restriction is so - restrictive - we develop "relaxed" models 
> (all content
> optional) and then layer on the minimum occurrence 
> constraints as a separate
> specification (validated in a separate, post-validation check). 
> 
> We'd love to find a standard way to express these constraints (and the
> obvious and widely discussed co-occurrence constraints) in a 
> schema, include
> the schema of our relaxed model to which they apply, and then have the
> schema-validating-constraint-checker do the rest for us.

Hmmmm....

Here's something similar that may give you an idea. In our industry we have
a standard XML vocabulary called a Job Definition Format (JDF), which is
humongous (450pp. spec). There's  an XML Schema that goes with it, but the
problem is that the narrative spec states that the elements are unordered.
Well, the <all> content model is even more restrictive than restricted
types, so you know that won't fly. What the standards group has done is to
define unbounded cardinality constraints in the XML Schema, and then built a
Xerces plug-in to check for the real cardinality constraints. You might be
able to use something similar.

I know Jeni and others have suggested using XSLT to rearrange doc elements
in schema order, but for docs this size that may be prohibitively expensive.


It would be fun (and time consuming) to write a RELAX NG version of this
schema, with the real cardinalities, and toss in a few Schematron
co-occurrence constraints.  No one will pay me to do it, though, so I'll
have to do it on my own nickel.

Received on Wednesday, 10 July 2002 16:33:34 UTC