Re: What is the type of an element with a fixed value?

The presence of a fixed value does not affect the type, which is 
determined in the usual way based on the type attribute or equivalent. 
In your examples there is no type attribute so the type is xs:anyType. 
The fixed value must of course be valid against the type, though if it 
isn't, this is considered a validation failure in the instance rather 
than a problem with the schema.

(IIRC, the use of a fixed value with a mixed content type such as 
xs:anyType is poorly defined in XSD 1.0 but is clarified in XSD 1.1)

Michael Kay
Saxonica

On 27/08/2012 22:35, Costello, Roger L. wrote:
> Hi Folks,
>
> What is the type of Foo?
>
>      <element name="Foo" fixed="Hello World" />
>
> Is it:
>
> (a) xs:string
>
> (b) xs:anyType
>
>
> What is the type of Bar?
>
>      <element name="Bar" fixed="93" />
>
> Is it:
>
> (a) xs:string
>
> (b) xs:decimal
>
> (c) xs:anyType
>
>
> /Roger
>
>

Received on Monday, 27 August 2012 23:07:44 UTC