W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2006

RE: Datatypes and mixed content

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
Message-Id: <OF1005BF46.A4353202-ON88257137.00614F67-88257137.006292C4@KP.ORG>

> My guess at the rationale is that the use-case for mixed content is 
> 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 
> 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 

Received on Monday, 20 March 2006 17:57:31 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:09 UTC