Re: Derivation by restriction Q?

Hi,

Jakub.Valenta@Deio.net wrote:

> If the original type is complex and mixed.
> The derived type has its complex content derived from the original type,
> but does not define itself as being mixed.
> Is the derived type also mixed or not.


 From *my* reading of the rec, the result of the derivation will be 
mixed only if defined as mixed in its own complexContent or complexType 
declaration:

http://www.w3.org/TR/xmlschema-1/#element-complexContent

1.2 otherwise a pair consisting of
1.2.1 the appropriate case among the following:
1.2.1.1 If the mixed [attribute] is present on <complexContent>, then 
mixed if its ·actual value· is true, otherwise elementOnly;
1.2.1.2 If the mixed [attribute] is present on <complexType> and its 
·actual value· is true, then mixed;
1.2.1.3 otherwise elementOnly.
1.2.2 The particle corresponding to the <all>, <choice>, <group> or 
<sequence> among the [children].

(more comments below)



> I don't know if the mixed property behave as the attributes which are
> ihnerited automatically if not stated otherwise,
> or if the mixed propery behaves as sub elements which are not inherited
> automatically if not stated otherwise.!?!
> 
> I would appreciate any help.
> 
> br,
> 
> Jakub Valenta
> 
> the following is the part of the XML schema I am dealing wiht, since the ED
> is mixed and its child element TN is defined as restriction of the ED is it
> also mixed?
> 
> <xsd:complexType name='ED' mixed='true'>
>     <xsd:annotation>
>       <xsd:appinfo>
>         <hl7:datatype>ED</hl7:datatype>
>         <hl7:pr>(@NULL or REF) and not(@NULL and REF)</hl7:pr>
>         <hl7:pr>@NULL or @MT</hl7:pr>
>       </xsd:appinfo>
>     </xsd:annotation>
>     <xsd:complexContent>
>       <xsd:extension base='v3dt:base'>
>         <xsd:sequence>
>           <xsd:element name='REF' type='v3dt:TEL' minOccurs='0' maxOccurs
> ='1'>
>             <xsd:annotation>
>               <xsd:appinfo>
>                 <hl7:property>reference</hl7:property>
>               </xsd:appinfo>
>             </xsd:annotation>
>           </xsd:element>
>           <xsd:element name='TN' minOccurs='0' maxOccurs='1'>
>             <xsd:annotation>
>               <xsd:appinfo>
>                 <hl7:property>thumbnaili</hl7:property>
>               </xsd:appinfo>
>             </xsd:annotation>

If you want it to be mixed, you should indicate it here:


>             <xsd:complexType>

                               ^
                               mixed="true"


>               <xsd:complexContent>
or                                 ^
                                   mixed="true"


Hope this helps.

Eric



>                 <xsd:restriction base='v3dt:ED'>
>                   <xsd:sequence>
>                     <xsd:element name='REF' type='v3dt:TEL' minOccurs='0'
> maxOccurs='1'/>
>                     <xsd:element name='TN' type='v3dt:ED' minOccurs='0'
> maxOccurs='0'/>
>                   </xsd:sequence>
>                 </xsd:restriction>
>               </xsd:complexContent>
>             </xsd:complexType>
>           </xsd:element>
> 
> 
> 



-- 
Rendez-vous ą Paris pour une visite guidee de la nebuleuse XML.
                                           http://dyomedea.com/formation/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------

Received on Thursday, 11 October 2001 10:48:36 UTC