When the choice construct is encountered in the schema
parser, it is added as a child node to the parent
element/type, and the content of the choice is
effectively ignored. A better thing would be to add
choice's children instead of choice. The purpose of
the schema parser is only to support the parsing of
GML documents, and not to validate schemas.
So, if there is a choice like (in pseudo-XSD):
<choice>
<A/>
<B/>
</choice>
For GML4J, this is the same as:
<sequence>
<A/>
<B/>
</sequence>
That is, GML4J is interested in the content of a type,
but not whether the content fully adheres to its XML
Schema definition. It's a loose adherence to the XML
Schema definition with the goal of recognizing all
possible elements in the contents rather than
restricting the content to valid values.
Regarding the example above, if an instance document
contains A and B elements one after another, GML4J
should recognize both (after we fix it) and not insist
that there be only one or the other.