Re: simpleType redefinition - must it be a restriction?

Hi Mark,

> Must a redefinition of a simpleType result in a more constrained
> simpleType? Or can it be less constrained?

Redefinitions of a simple type must be restrictions of that simple
type (since <simpleType> elements within a <redefine> element must
have a <restriction> child). Restrictions within a redefine follow the
same rules as restrictions elsewhere.

> XMLSpy says that any of AUD, EUR, USD or USD (!) are allowed in the
> instance document that references the redefinition xsd. It appears
> to have created a union of the original and the redefined
> enumeration sets.
>
> XSV says that only USD and AUD are allowed, treating the redefined
> enumeration set as overriding the original.
>
> I expected the redefinition to be flagged as an error, with the new
> definition not being a proper subset of the original.
>
> What is the correct interpretation?

I think your interpretation is the correct interpretation. When you
restrict a simple type, the facets have to be valid restrictions of
the facets of the base type. In your example the base type had a value
space of (USD, EUR); the derived type had an enumeration facet of
(USD, AUD).

According to the XML Schema Datatypes Rec, Section 4.3.5.5 Constraints
on enumeration Schema Components:

  Schema Component Constraint: enumeration valid restriction

  It is an ˇerrorˇ if any member of {value} is not in the ˇvalue
  spaceˇ of {base type definition}.

The restriction is therefore an error because the value 'AUD' is not
in the value space of the base type.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Saturday, 5 January 2002 08:14:58 UTC