Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [XSD2Ecore] is removing removing underscore from EEnumLiteral name and not setting literal
[XSD2Ecore] is removing removing underscore from EEnumLiteral name and not setting literal [message #984678] Wed, 14 November 2012 17:21 Go to previous message
David Rees is currently offline David Rees
Messages: 47
Registered: September 2012
Member
I'm running into a name mapping problem where XSD2Ecore is mapping an Restriction with Enumeration Facets to an EENum. Each enumeration value has an underscore, but the corresponding EEnumLiteral's name has the underscore removed and the it's literal is not properly set to original value either. I'll add I don't think removing the underscore should be required to make it a valid Java name anyway.

Is this a bug or am I missing an option somewhere?

Thanks,
dave

Here is the XSD snippet:
    <xsd:simpleType name="DATA-TYPE">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="A_INT32"/>
            <xsd:enumeration value="A_UINT32"/>
            <xsd:enumeration value="A_FLOAT32"/>
            <xsd:enumeration value="A_FLOAT64"/>
            <xsd:enumeration value="A_ASCIISTRING"/>
            <xsd:enumeration value="A_UTF8STRING"/>
            <xsd:enumeration value="A_UNICODE2STRING"/>
            <xsd:enumeration value="A_BYTEFIELD"/>
        </xsd:restriction>
    </xsd:simpleType>


And here is generated Ecore (in OCLinEcore):
	enum DATATYPE { serializable }
	{
		annotation _'http:///org/eclipse/emf/ecore/util/ExtendedMetaData'
		(
			name = 'DATA-TYPE'
		);
		literal AINT32;
		literal AUINT32 = 1;
		literal AFLOAT32 = 2;
		literal AFLOAT64 = 3;
		literal AASCIISTRING = 4;
		literal AUTF8STRING = 5;
		literal AUNICODE2STRING = 6;
		literal ABYTEFIELD = 7;
	}


Thanks,
dave
 
Read Message
Read Message
Read Message
Previous Topic:Problem referencing another emf project
Next Topic:[CDO] CDOAdmin - NullPointerException on Server side using TCP connector
Goto Forum:
  


Current Time: Sat May 25 21:33:22 EDT 2013

Powered by FUDForum. Page generated in 0.01636 seconds