Deriving from xs:anySimpleType

There are some interesting test cases in the new test suite. One which has
me rather flummoxed for the moment is the Microsoft test (in SimpleType)
stZ007.xsd, the relevant part being:

    <xs:complexType name="t1">
	<xs:simpleContent>
         <xs:extension base="xs:anySimpleType" />
      </xs:simpleContent>
    </xs:complexType>

    <xs:complexType name="t2">
	<xs:simpleContent>
         <xs:restriction base="t1"/>
      </xs:simpleContent>
    </xs:complexType>

    ... <xs:element name="e2 type="t2"/>

According to the metadata this is valid, and indeed, I can't see any rules
that it breaks. But I'm having trouble building the component model for t2.

What {variety} of type is the simpleContent type of t2? It must be a simple
type, and according to the component model for simple types, every simple
type has a {variety} which is one of list, atomic, or union. (The 1.1 spec
clarifies that for anySimpleType, {variety} is absent, and at the same time
confirms that it is present for every other simple type). We also read:

every simple type definition is a .restriction. of some other simple type
(the {base type definition}), which is the .simple ur-type definition. if
and only if the type definition in question is one of the built-in primitive
datatypes, or a list or union type definition which is not itself derived by
restriction from a list or union respectively. 

In the "Complex Type Definition with simple content Schema Component"
definition, we can see that the {content type} of t2 is "a simple type
definition which restricts [xs:anySimpleType] with an [in this case empty]
set of facet components." But what {variety} of simple type definition is
this? (The 1.1 spec is unchanged in this area).

If the restriction of t1 had any facets, what would they mean (e.g. a length
facet)?

Any advice much appreciated!

Michael Kay

Received on Wednesday, 15 November 2006 22:59:12 UTC