Re: Fw: SimpleType, SimpleContent, Redefine

Hi,

Bruno Chatel wrote:
>  Hello,
> 
>  I would like to know if the following compleType defintion is allowed:
> 
>  <xs:complexType name="unit">
>        <xs:simpleContent>
>             <xs:extension base="xs:integer"/>
>        </xs:simpleContent>
>   </xs:complexType>

Yes, why not ;=) ?

>  It seems to be equivalent than :
> 
>  <xs:simpleType name="unit">
>      <xs:restriction  base="xs:integer"/>
>  <xs:simpleType>

Not really, simple and complex types are very different beasts (despite 
similarities which are IMO exagerated in the W3C Recommendation) and the 
kind of derivations which you will be able to do on those types is 
different.

>  In fact, I want to define an "interface" of the unit type in order to redefine it :
>  (with the first unit complexType def)
> 
>   <xs:redefine schemaLocation="unit.xsd">
>        <xs:complexType name="unit">
>             <xs:simpleContent>
>                  <xs:extension base="unit">
>                       <xs:attribute name="otherVal" type="xs:integer" use="required"/>
>                  </xs:extension>
>             </xs:simpleContent>
>        </xs:complexType>
>   </xs:redefine>
> 
>  This redefinition seems to be forbiden (xsv error : Basing a type on itself is
> forbidden).
>  This error is raised only when I try to redefine a complexType with a simpleContent.
>  A redefine of a complexType (with a complexContent) using the same name seems
>  to be correct ...

I would *bet* for a bug since the rec states that:

Within the [children], each <simpleType> must have a <restriction> among 
its [children] and each <complexType> must have a restriction or 
extension among its grand-[children] the ·actual value· of whose base 
[attribute] must be the same as the ·actual value· of its own name 
attribute plus target namespace;

without mentioning any restriction for simple contents.

Eric

> 
>  Thanks in advance
> 
>  Regards
> 
> 
>  -- bruno --
>  Bruno Chatel
>  Tel : (+33)[0] 4 96 11 14 57
>  Email : bcha@chadocs.com
> http://www.chadocs.com
>  ----------------------------------------
-- 
See you in Paris.
                      http://www.afnet.fr/afnet/net200x/programme.html#T9
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------

Received on Wednesday, 20 March 2002 07:18:16 UTC