You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "Simmie, Anne Marie" <am...@protana.com> on 2005/01/14 15:19:00 UTC

FW: Map specific names to enum classes

Is there a way to include non-English characters in an enumerated class?  I have a schema which contains a restriction that has non-English characters:
 
...
<xs:simpleType name="unit_list">
 <xs:restriction base="xs:string">
  <xs:enumeration value="µM"/>
  <xs:enumeration value="nmol/min/ml"/>
  <xs:enumeration value="µg/L"/>
  ...
 </xs:restriction>
</xs:simpleType> 
 
(if your browser isn't set to UTF-8, the greek letter "mu" is in the enumerated list)
 
When scomp tries to translate it, it throws an error from the Java compiler that suggests it doesn't like the names that were automatically assigned:
 
C:\...\Temp\xbean18211.d\src\noNamespace\UnitList.java:210: ';' expected
        static final int INT_?_U_ML = 51;
                             ^
To fix this, I thought perhaps I could assign specific names to the enumeration, telling it how to name those classes and avoid the mu's.  I've taken a look at the example in the FAQ on how to map specific element/attribute names to java names, but I don't really see how to do the same thing for the constants assigned to an enumeration.  I did tried playing with it but I don't think scomp likes the mu's in the .xsdconfig file:
 
C:\code\plasmaConfig.xsdconfig:1: error: Character conversion error: "Unconvertible UTF-8 character beginning with 0xb5" (line number may be too low).
Time to build schema type system: 1.051 seconds
BUILD FAILED
 
Does anyone know if there is a way to include these non-English characters in my enumeration?
 
Thanks,
Anne Marie
 
------------------------------
 
Anne Marie Simmie

Bioinformatics Associate Scientist

Scientific Computing

Protana Inc.

Toronto, Ontario, Canada