RE: Restricting the simpleContent of a complexType

Yep - Spy is wrong on this one.  

I also encountered this problem: when it comes to 
the restriction, Spy suddently thinks that "baseType" is 
complexType with complexContent in spite of the original 
declaration.  

I notified Altova about this something like 5 months ago, 
and they acknowledged the problem.  

Even more confusing, I think Spy gives different 
answers in "schema Design View" and "Text View" ...

_____
[This mail represents part of a discussion of work in progress 
and should not be used for any purpose without my permission.] 
_____
Simon.Cox@csiro.au  CSIRO Exploration & Mining
26 Dick Perry Avenue, Kensington WA 6151
PO Box 1130, Bentley WA 6102  AUSTRALIA
T: +61 (8) 6436 8639  F: +61 (8) 6436 8555  C: +61 (4) 0330 2672
http://www.csiro.au/page.asp?type=resume&id=CoxSimon

> -----Original Message-----
> From: Eddie Robertsson [mailto:erobertsson@allette.com.au]
> Sent: Thursday, 16 May 2002 8:15 AM
> To: lispj@mail.ukoln.ac.uk
> Cc: xmlschema-dev@w3.org; lispj@ukoln.ac.uk
> Subject: Re: Restricting the simpleContent of a complexType
> 
> 
> Hi,
> 
> >   <xs:complexType name="baseType">
> >     <xs:simpleContent>
> >       <xs:extension base="xs:string">
> >         <xs:attribute ref="x:lang" use="optional"/>
> >       </xs:extension>
> >     </xs:simpleContent>
> >   </xs:complexType>
> >
> >   <xs:complexType name="RFC1766">
> >    <xs:simpleContent>
> >     <xs:restriction base="baseType">
> >       <xs:simpleType>
> >           <xs:restriction base="xs:language"/>
> >         </xs:simpleType>
> >         <xs:attribute ref="x:lang" use="prohibited"/>
> >     </xs:restriction>
> >    </xs:simpleContent>
> >   </xs:complexType>
> >
> > It seemed to me this should be OK as xs:language is derived 
> from xs:string. As
> > far as I can see, this _seems_ to be acceptable to the XSV 
> (latest release),
> > Xerces Java 2 (latest release) and MSXML (probably not 
> quite the most recent
> > update), but XML Spy rejects it (complaining that 
> xs:simpleType is unexpected
> > at that location in the derived type definition).
> >
> > I'm inclined to go with the majority vote here, but I would 
> welcome some
> > reassurance that this is OK - or, indeed, a clear 
> indication that it is broken!
> 
> I would say this is valid as well. According to [1]:
> 
> "1 if the type definition ·resolved· to by the ·actual value· 
> of the base
> [attribute] is a complex type
>  definition (whose own {content type} must be a simple type 
> definition, see below)
> and the
>  <restriction> alternative is chosen, then starting from either
>       1.1 the simple type definition corresponding to the 
> <simpleType> among the
> [children] of
>             <restriction> if there is one;
>       1.2 otherwise (<restriction> has no <simpleType> among 
> its [children]), the
> simple type
>             definition which is the {content type} of the 
> type definition
> ·resolved· to by the ·actual value·
>             of the base [attribute]
>  a simple type definition which restricts that simple type 
> definition 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) (§3.14.3);
> ..."
> 
> I'd say your example match 1 and then 1.1.
> 
> Cheers,
> /Eddie
> 
> [1] http://www.w3.org/TR/xmlschema-1/#declare-type (In the 
> table under the heading:
> "Complex Type Definition with simple content Schema 
> Component", section "{content
> type}")
> 

Received on Wednesday, 15 May 2002 21:38:19 UTC