I have to describe a choice between multiple region types which all contain "coordinates". Unfortunately it is not allowed to have multiple xsd elements with the same name - it does not matter if they are defined multiple times or just referenced to multiple times.
<xs:group name="Region">
<xs:choice>
<xs:group ref="tns:CircularRegion" />
<xs:group ref="tns:RectangularRegion" />
<xs:group ref="tns:PolygonalRegion" />
</xs:choice>
</xs:group>
With the referenced groups:
<xs:group name="Coordinates">
<xs:sequence>
<xs:element name="Latitude" type="xs:integer" />
<xs:element name="Longitude" type="xs:integer" />
</xs:sequence>
</xs:group>
<xs:group name="CircularRegion">
<xs:sequence>
<xs:group ref="tns:Coordinates" />
<xs:element name="Radius" type="xs:integer" />
</xs:sequence>
</xs:group>
<xs:group name="RectangularRegion">
<xs:sequence>
<xs:group ref="tns:Coordinates" />
<xs:group ref="tns:Coordinates" />
</xs:sequence>
</xs:group>
<xs:group name="PolygonalRegion">
<xs:sequence>
<xs:group minOccurs="3" maxOccurs="12" ref="tns:Coordinates" />
</xs:sequence>
</xs:group>
As "Latitude" and "Longitude" are referenced to multiple times, the validation process ends with an error (multiple definitions...).
Any idea how to solve this?
EDIT The error message (German) from "Liquid XML Studio 2012" validator:
Error Mehrere Definitionen des Elements 'Psid' verursachen ein mehrdeutiges Inhaltsmodell. Ein Inhaltsmodell muss so gebildet werden, dass während der Validierung einer Elementinformationssequenz das darin direkt, indirekt oder implizit enthaltene Partikel, mit dem versucht wird, jedes Element in der Sequenz zu validieren, wiederum eindeutig bestimmt werden kann, ohne den Inhalt oder die Attribute dieses Elements zu untersuchen und ohne dass beliebige Informationen zu den Elementen im Rest der Sequenz benötigt werden.
In English (Google translate)
Error Several definitions of element Psid 'cause an ambiguous content model. A content model must be formed such that during validation of an element information sequence that is directly, indirectly or implicitly contained particles that attempts to validate each element in the sequence in turn can be uniquely determined without the content or attributes of that item are required to investigate and without any information about the items in the rest of the sequence.