- From: Lars Geldner <geldner.list.reg@gmx.net>
- Date: Mon, 27 Dec 2004 23:53:34 +0100 (MET)
- To: xmlschema-dev@w3.org
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 Tuesday, 28 December 2004 01:25:22 UTC