<xs:element name="Kunde" type="tKunde"/>
<xs:complexType name="tKunde">
<xs:union memberTypes="tPerson tStudent"></xs:union>
</xs:complexType>
<xs:complexType name="tPerson">
<xs:sequence>
<xs:element name="Vorname" type="xs:string"/>
<xs:element name="Nachname" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tStudent">
<xs:complexContent>
<xs:extension base="tPerson">
<xs:sequence>
<xs:element name="Matrikelnummer" type="xs:int" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Thats what it should look like. The task is to derive a Student from Person and then make it possible to use one of the two types for the element Kunde.
This seems to be invalid.
Specifies the name of a built-in data type, a simpleType element, or a complexType element. any attributes. Optional. Specifies any other attributes with non-schema namespace.
xs:simpleType define a value type, this value can then be used within an element or attribute (so you could define an double with 2 decimal places or a string in the format of an IP address). xs:complexTypes describe the structure of an element. It can define its textual value, its attributes and its child elements.
<xs:element name="name" type="xs:string"/> <xs:element name="navn" substitutionGroup="name"/> <xs:complexType name="custinfo"> <xs:sequence> <xs:element ref="name"/>
<xs:restriction base="xs:positiveInteger"> <xs:maxInclusive value="42"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="sizebystring">
You can't use xs:union for this. You can either use xs:choice, or put the elements in a substitution group so any of them can appear in place of the element at the head of the substitution group.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With