It is obvious that DTDs are a non-starter when judged against these criteria. I think it’s also obvious that Schematron does very well. I would claim that RELAX NG also does well here, and is better in this respect than other grammar-based schema language, in particular XSD. First, it carefully avoids anything that ties a document to a single schema
there’s nothing like xsi:schemaLocation or DOCTYPE declarations
there’s nothing that ties a particular namespace name to a particular schema; from RELAX NG’s perspective, a namespace name is just a label
there’s nothing in RELAX NG that changes a document’s infosetSecond, it has powerful features for expressing loose/open schemas:it supports full regular tree grammars, with no ambiguity restrictions
it provides namespace-based wildcards for names in element and attribute patterns
it provides name classes with a name class difference operator
another in the ever growing litany why XSD sucks
But how do you interop with a world that uses XSD as the wire format for contracts? The minimum is to create a tool that can take a TEDI schema with XML annotations and generate an XSD. There’ll be limits because of the limited power of XSD (and these will need to be taken into consideration in designing the TEDI XML binding): some of the constraints of the TEDI schema might not be captured by the XSD. But that’s a normal situation: there are often complex constraints on an XML document being interchanged that cannot be expressed in XSD.
James Clark we need a new kind of schema language, and I concur.