Ich möchte in XSD folgendes ausdrücken:
Momentan sieht das wie folgt aus:
Das ist allerdings ziemlich umständlich, wenn ich neue Operatoren wie Minus, Multiplikation, Division etc. hinzufügen möchte.
Ich hatte mir sowas vorgestellt wie:
Also Plus erwartet einfach nur zwei Elemente vom Typ "term" und der Name ist dabei egal. Ist sowas in der Art in XSD möglich? Ich möchte einfach die Dopplung im Text minimieren.
vielen Dank im voraus,
TheStormy
Code:
<term>
<plus>
<zahl>4</zahl>
<zahl>5</zahl>
</plus>
</term>
Momentan sieht das wie folgt aus:
Code:
<xsd:complexType name="term">
<xsd:choice>
<xsd:element name="plus" type="plus">
<xsd:element name="zahl" type="zahl">
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="plus">
<xsd:sequence>
<xsd:element name="plus" type="plus">
<xsd:element name="zahl" type="zahl">
</xsd:sequence>
</xsd:complexType>
Das ist allerdings ziemlich umständlich, wenn ich neue Operatoren wie Minus, Multiplikation, Division etc. hinzufügen möchte.
Ich hatte mir sowas vorgestellt wie:
Code:
<xsd:complexType name="plus">
<xsd:sequence>
<xsd:element type="term">
<xsd:element type="term">
</xsd:sequence>
</xsd:complexType>
Also Plus erwartet einfach nur zwei Elemente vom Typ "term" und der Name ist dabei egal. Ist sowas in der Art in XSD möglich? Ich möchte einfach die Dopplung im Text minimieren.
vielen Dank im voraus,
TheStormy