Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Deriving from xs:anySimpleType

From: Sandy Gao <sandygao@--.---.--->
To: "Michael Kay" <mike@--------.--->
Date: 11/16/2006 5:22:00 AM
In 3.4.2 of structures 1.0

"a simple type definition which restricts the simple type definition 
identified in clause 1.1 or clause 1.2 with a set of facet components 
corresponding to the appropriate element information items among the 
<restriction>'s [children] (i.e. those which specify facets, if any), as 
defined in Simple Type Restriction (Facets) (=A73.14.6);"

For the attached example, I think this is equivalent to the following 
definition:

 <xs:simpleType>
  <xs:restriction base="xs:anySimpleType"/>
 </xs:simpleType>

Is this simple type definition valid? I think it's normally considered 
invalid, but I'm having trouble finding constraints that rule this out, 
other than the non-normative statement in 3.14.1:

"... every simple type definition is a =B7restriction=B7 of some other simp=
le 
type (the {base type definition}), which is the =B7simple ur-type 
definition=B7 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."

The "if an only if" part would rule out a simple type with {base type 
definition} anySimpleType and {variety} absent.

I think some clarification/fix-up is in order. I can see 2 ways:
1 Make it explicit that the above simple type is ruled out (hence the 
complex type case). (This may already be the case, as I had always thought =

the simple type case was not allowed.)
2 Make it explicit that the above simple type is ruled out, but still 
allow the complex type case (when no facet is specified).

To achieve #2, 3.4.2 will need to be updated to say "if no facet is 
specified, then just use the simple type from the base type; otherwise 
construct a new one".

I like #2, because it makes a class of simple content scenarios possible, 
where the <restriction> is only meant to restrict attributes and doesn't 
want to change the simple type.

Thanks,
Sandy Gao
XML Parser Development, IBM Canada
(1-905) 413-3255
sandygao@c...


xmlschema-dev-request@w... wrote on 2006-11-15 05:59:01 PM:

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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent