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

Re: What is the data type of a fixed element that has no type attribute?

From: C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>
Date: Mon, 26 Mar 2012 12:31:36 -0600
Cc: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>, "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-Id: <6C9E643B-2D5F-4746-8B4D-8574A61994A3@blackmesatech.com>
To: "G. Ken Holman" <gkholman@CraneSoftwrights.com>
Nice work, Ken!  You seem to have disproved my claim that it's hard
to tell what the processor might be complaining about, if the query
does not tell us what the processor says.

On Mar 26, 2012, at 12:03 PM, G. Ken Holman wrote:

> At 2012-03-26 17:45 +0000, Costello, Roger L. wrote:
>> Hi Folks,
>> What is the data type of this fixed element:
>>      <element name="Aircraft" fixed="boeing:AC-747" />
> A "simple ur-type definition" because you haven't said otherwise.
>  W3C Schema Part 1 Section 3.2.2:
>  "The default when no simple type definition is referenced or provided
>   is the Ěsimple ur-type definitionĚ, which imposes no constraints at all."

True as far as it goes, but 3.2.2 is talking about attribute declarations,
not element declarations.

Here, I think the governing text is the mapping rule for the {type
definition} property of element declarations, described in

>> Can an XML instance document specify that its type is a QName, like so:
>>      <Aircraft xsi:type="xs:QName">boeing:AC-747</Aircraft>
>> That results in an error, why?
> There are a bunch of errors there.  To make it well-formed you need:
> <Aircraft xsi:type="xs:QName"
>          xmlns:boeing="urn:X-MD"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xmlns:xs="http://www.w3.org/2001/XMLSchema">boeing:AC-747</Aircraft>
> But you can't make it schema valid to your constraint of the value being a fixed string, because the value is a QName.  Lexically they may be the same, but the schema values are different types.

Good point.  (For those who want to trace this back to the spec, check
the rule for the {value constraint} property in section  if a value
constraint is specified for an element whose type is not a simple type
and not a complex type with simple content, then xsd:string is used as
the type for the value constraint.

* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
Received on Monday, 26 March 2012 18:32:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:16:01 UTC