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

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 3.3.2.1.

> 
>> 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 3.3.2.1:  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