RE: not a complete functional mapping - help

Saxon reports another error in this schema: the element MODUL cannot be a
member of the substitution group headed by element CurrKomp, because type
MODULType is not derived by restriction from type CurrType.

If the element declaration for MODUL is changed to say type="CurrType",
Saxon accepts the schema as valid. Like XSV, it implements the spirit of the
type subsumption rules in preference to implementing the letter of the
rules.

Michael Kay
http://www.saxonica.com/

 

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Lars Geldner
> Sent: 27 December 2004 22:54
> To: xmlschema-dev@w3.org
> Subject: not a complete functional mapping - help
> 
> 
> Hello list,
> 
> I'm working for a few days on this problem:
> I'm searching for a possibility to define a complex type that 
> can only be
> derived by restriction. The sub-complex type should have a 
> content model
> that only contains elements which have types that are a 
> derivation of the
> element types in the super-complex type.
> For example here are two types that should be derived:
> 
> <xsd:element name="CurrKomp" abstract="true" type="CurrType"/>
> <xsd:element name="DidaktKomp" abstract="true" type="DidaktType"/>
> <xsd:complexType name="CurrType">
>    <xsd:choice minOccurs="1" maxOccurs="unbounded">
>       <xsd:element ref="CurrKomp" minOccurs="0" maxOccurs="1"/>
>       <xsd:element ref="DidaktKomp" minOccurs="0" 
> maxOccurs="1"/>	          
>    </xsd:choice>
> </xsd:complexType>
> <xsd:complexType name="DidaktType">
>    <xsd:choice minOccurs="1" maxOccurs="unbounded">
>       <xsd:element ref="DidaktKomp" minOccurs="0" maxOccurs="1"/>
>    </xsd:choice>
> </xsd:complexType>
> 
> In type "CurrType" the model is only one possibility. The goal is that
> "CurrKomp" and "DidaktKomp" can appear in any order.
> Now I want to restrict the two types:
> 
> <xsd:element name="KURS" substitutionGroup="CurrKomp" 
> type="KURSType"/>
> <xsd:element name="MODUL" substitutionGroup="CurrKomp" 
> type="MODULType"/>
> <xsd:element name="LERNZIEL" substitutionGroup="DidaktKomp" 
> type="LZType"/>
> <xsd:complexType name="KURSType">
>    <xsd:complexContent>
>       <xsd:restriction base="CurrType">
>          <xsd:sequence>
>             <xsd:element ref="LERNZIEL"/>
>             <xsd:choice maxOccurs="unbounded">                
>             
>                <xsd:element ref="MODUL"/>
>             </xsd:choice>
>          </xsd:sequence>
>       </xsd:restriction>
>    </xsd:complexContent>
> </xsd:complexType>
> <xsd:complexType name="MODULType">
> <!--no error-->
> </xsd:complexType>
> <xsd:complexType name="LZType">
>    <xsd:complexContent>
>        <xsd:restriction base="DidaktType"/>
>    </xsd:complexContent>
> </xsd:complexType>
> 
> Xerces says:
> rcase-MapAndSum.1: There is not a complete functional mapping 
> between the
> particles. [30] 
> derivation-ok-restriction.5.4.2: Error for type 'KURSType'. 
> The particle of
> the type is not a valid restriction of the particle of the base. [30] 
> 
> Why is KURSType not a valid restriction of CurrType?
> If I remove the line
> <xsd:element ref="LERNZIEL"/>
> there are no errors.
> I can't face it.
> Can anybody help me defining a type that behaves like a 
> meta-type pretending
> all types in the content model?
> 
> Thanks in advance!!!
> 
> Lars Geldner 
> 
> 
> -- 
> Psssst! Mit GMX Handyrechnung senken: http://www.gmx.net/de/go/mail
> 100 FreeSMS/Monat (GMX TopMail), 50 (GMX ProMail), 10 (GMX FreeMail)
> 
> 
> 

Received on Thursday, 30 December 2004 19:42:18 UTC