Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Generating errors in java class from an xsd file that contains special character like "µ"(my java classes doesn't understand the µ and ° character and replace them with "?".)
Generating errors in java class from an xsd file that contains special character like "µ" [message #1855434] Thu, 13 October 2022 19:20 Go to next message
Junior Developpeur04 is currently offline Junior Developpeur04Friend
Messages: 1
Registered: October 2022
Junior Member
Hello community,

I had an xsd file that contains an element whithim their values containes different special character like :

<xsd:enumeration value="DB/µV"/>
<xsd:enumeration value="dB(A)"/>
<xsd:enumeration value="°"/>.

When I generate the model ,my java classes doesn't understand the µ and ° character and replace them with "?".

How can I fix it?
Re: Generating errors in java class from an xsd file that contains special character like "µ&q [message #1855435 is a reply to message #1855434] Fri, 14 October 2022 06:14 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
Registered: July 2009
Senior Member
Those aren't valid characters to use in a *.xsd for this purpose.

Best would be to add ecore:name annotation to give it a meaningful name:
<xsd:enumeration ecore:name="Degree" value="°"/>

Of course you should declare xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" too. For me that generates this:
DEGREE(0, "Degree", "\u00b0")


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Proper way to store and save EObjects
Next Topic:[EMF] Dedicated editing domain for each model element editor in RCP?
Goto Forum:
  


Current Time: Thu May 02 11:40:29 GMT 2024

Powered by FUDForum. Page generated in 0.03296 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top