Skip to main content



      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 15:20 Go to next message
Eclipse UserFriend
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 02:14 Go to previous message
Eclipse UserFriend
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")
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: Mon Jun 30 20:17:58 EDT 2025

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

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

Back to the top