|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Remember to RELAX (was RE: Are there still a lot of peopleusingDTD)
Bob Kline wrote: > I've assumed (from a distance) based on statements that use phrases like > "upward compatibility" and "easy transition" that the functionality > provided by RELAX was a subset of that provided by XML Schema. However, > I haven't found anything in the latter comparable to the attribute- > sensitive content models supported by RELAX. Is this because XML Schema > doesn't have such a feature, or just because it's harder to find things > in the more densely-worded Schema documentation (or perhaps just because > I'm not reading carefully enough)? Yes, XML Schemas has (almost) no "co-occurence" constraints. Type is determined by * element name (in context of its parent's type) or * xsi:type attribute where allowed So attributes cannot be used to specify attributes related to typing. (Well, they can be used, just that XML Schemas cannot make any use of that information.) They cannot override a facet or set a type. (xsi:null="yes" does not change the type of an element, or set a value or facet. It changes something else: a property?) RELAX (and DCD) provide something much better: they allow co-occurence constraints. I think these are limited to just element names and attributes along the ancestor axis, so that stream-processing can be done. Schematron allows constraints from any axis, including poking around other documents. Dave Ragget's Assertion Grammars started the idea AFAIK. I have mentioned this before, and I have harped on about it frequently and unattractively on the XML Schema mail-lists at W3C. But no-one from the public raised it as a Last Call issue, so it seems that people don't want it. I think all the schema languages that fed into XML Schemas just keyed the type from element names (perhaps in context of parent element name) and no-one complained about them. I cannot understand why there is not more fuss about it: it gets rid of what I consider the prime use (apart from ID/IDREF) of attributes--to provide subclassing information. DTDS had it for datatyping: you could constrain an element to be certain notations and select which notation was used. However, XML Schemas supports standard datatypes not arbitrary user-defined ones, so it does not support things like <date type="US">12-31-2000</date> An alternative way to look at it, I suppose, is that people are happy to use schemas to specify the static constraints on a document's structure and then use Schematron (or home-made equivs) to specify the dynamic, attribute-provided constraints. That is the model I am reluctantly expecting for 2001. If you want to use attributes for subclassing, and if there is another Last Call draft of XML Schemas (not at all guaranteed: people and their employers are pretty tired), please send comments to the appropriate W3C mailling list. Rick Jelliffe
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








