- From: <Paul.V.Biron@kp.org>
- Date: Mon, 20 Mar 2006 09:56:36 -0800
- To: mike@saxonica.com
- Cc: trondaks@stud.ntnu.no, xmlschema-dev@w3.org, xmlschema-dev-request@w3.org
> My guess at the rationale is that the use-case for mixed content is marking > up text. > > There's no desire to support constructs such as > > <price><currency>GBP</currency> 125.00 </price> > > where it's more suitable to use an attribute, or to add tags around the > decimal value; therefore there's no support for this in the spec. > > I think the underlying thinking is that XML Schema isn't designed to let you > describe any XML document whatsoever, it's only designed to allow you to > describe documents that are considered to be well designed. Actually, we tried a number of designs to support this sort of thing but could never reach concensus on how to support the range of use cases. Most of the use cases had i18n implications (i.e., someone want to control the character repertoire of the characters in mixed content), rather than cases like the price above. However, that price example is easier to illustrate the diffiulties, so I'll keep going with it. Suppose you wanted to say: type the character data as decimal with totalDigits=5 and fractionDigits=2. Then the above would seem to valid. However, what if you get an instance like: <price> 345.92 <currency>GBP</currency> 125.00 </price> Is that valid? One answer is yes, because each sequence of characters in the mixed content is valid according to the type. Another answer is no, because the text() value of <price> is ' 345.92 125.00 ', which is not valid according to the type. Some people want/need to define the type where the answer would be yes and others want/need no...and we couldn't reach concensus on how to support both (it is not as easy as saying, let the schema author specify with a switch...although my memory is failing me on the particulars at the moment). pvb
Received on Monday, 20 March 2006 17:57:31 UTC