users@jaxb.java.net

XJC parsing loops forever on tiny example

From: Herve Bitteur <Herve.Bitteur_at_Sun.COM>
Date: Wed, 17 Sep 2008 08:38:37 +0200

Bonjour,

Can someone tell me why xjc gets into an endless loop when parsing the
following simple example?
- As it is, the example puts xjc parsing phase in some endless loop
- It works correctly if I remove the *maxOccurs="unbounded"* for _harmony_.
- It also works correctly if I replace the *choice* between the _bass_
and _kind_ elements by a sequence.

I'm using hudson-jaxb-ri-2.1-646
Thanks for any help
/Hervé
[I mistakenly posted this msg on jaxb forum yesterday, but it really
belongs to this users list. Sorry for the duplication if any]


Here is the 26-line long xsd file:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xlink="http://www.w3.org/1999/xlink"
elementFormDefault="qualified" attributeFormDefault="unqualified">
   
    <xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.musicxml.org/xsd/xml.xsd"/>
    <xs:import namespace="http://www.w3.org/1999/xlink"
schemaLocation="http://www.musicxml.org/xsd/xlink.xsd"/>
   
    <xs:complexType name="harmony">
        <xs:sequence>
            <xs:group ref="harmony-chord" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
   
    <xs:group name="harmony-chord">
        <xs:sequence>
            <xs:choice>
                <xs:element name="bass" type="style-text"/>
                <xs:element name="kind" type="style-text"/>
            </xs:choice>
            <xs:element name="function" type="style-text"/>
        </xs:sequence>
    </xs:group>
   
    <xs:complexType name="style-text">
    </xs:complexType>
   
</xs:schema>