users@jaxb.java.net

Integer in Enumeration value

From: Sam Cheung <sylcheung_at_hotmail.com>
Date: Sun, 15 Feb 2004 06:00:52 +0000

Hi,

I have this emumeration in my schema, but I got an
enumeration-valid-restriction error when I try to run xjc to generate Java
code:
<xs:simpleType name="versionType">
                <xs:restriction base="xs:NCName">
                        <xs:enumeration value="5.0.1" />
                        <xs:enumeration value="5.0.2" />
                        <xs:enumeration value="5.0.3" />
                </xs:restriction>
        </xs:simpleType>

I got this error when I run xjc to generate code:
[xjc] [ERROR] enumeration-valid-restriction: enumeration value '5.0.1' is
not in the value space of {base type definition}.
      [xjc] line 394 of REL-5-MM7-1-3.xsd.out

I try adding this annotation in the element, but that does not help.
                        <xs:appinfo>
                                <jxb:avaType name="string"/>
                        </xs:appinfo>

I also try adding this in the binding file, but that does not help also.
<jxb:globalBindings
           typesafeEnumBase="xs:NCName"
           />

But when I change the value of the enumeration value to "a.b.c", everything
works fine.

So I think it is the integer in the value causes the problem.

Does anyone know how to resolve this problem?
Any help is appreciated.

Thank you.
Sam

_________________________________________________________________
Create your own personal Web page with the info you use most, at My MSN.
http://click.atdmt.com/AVE/go/onm00200364ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net