Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XMIException when binding two languages
XMIException when binding two languages [message #1727918] Tue, 29 March 2016 12:04 Go to next message
Eleanor Richie is currently offline Eleanor RichieFriend
Messages: 125
Registered: August 2014
Senior Member
I have to languages and tried to bind them with each other. Let then definition and usage languages for example and I am importing definition into usage. I followed exactly these steps https://christiandietrich.wordpress.com/2012/08/07/xtext-referencing-elements-of-one-dsl-from-another-dsl/ .
After the generation I get this exception in the usage.ecore
XMIException: org.xml.sax.SAXParseException: White spaces are required between publicId and systemId. (http://www.comp.com/my/language/usage/Usage, 1 , 50)

I am using xtext 2.8.2

Any help please, why when I use the def lang. in the other one it gives this error?
Re: XMIException when binding two languages [message #1727919 is a reply to message #1727918] Tue, 29 March 2016 12:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14067
Registered: July 2009
Senior Member
either you do not propertly register your languages or you destroy the emf registry.

how do you execute this? in a java main? if so call

DependentDslStandaloneSetup.doSetup();
new DependingDslStandaloneSetup().createInjectorAndDoEmfRegistration();

from eclipse:
never call any standalonesetups


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XMIException when binding two languages [message #1727920 is a reply to message #1727919] Tue, 29 March 2016 12:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14067
Registered: July 2009
Senior Member
in the emf xtext/generator this should never happen.
if this is the case place share a reproducable example


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XMIException when binding two languages [message #1728115 is a reply to message #1727920] Thu, 31 March 2016 08:16 Go to previous messageGo to next message
Eleanor Richie is currently offline Eleanor RichieFriend
Messages: 125
Registered: August 2014
Senior Member
Hi Christian, I couldn't produce it in a reduced grammar, actually my grammar is about 200+ rules. I followed this https://www.eclipse.org/forums/index.php/t/204865/ and it worked with me.
I just have one question, what is the difference between the writing the grammar rules like this :
---declaration returns MyDeclaration
---declaration returns ecore::EObject : {MyDeclaration}

I noticed that both create a MyDeclaration class and interface that extends EObject, so what is the main difference here?
Re: XMIException when binding two languages [message #1728117 is a reply to message #1728115] Thu, 31 March 2016 08:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14067
Registered: July 2009
Senior Member
the usecase is

declaration returns Supertype : {SubType}


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XMIException when binding two languages [message #1728120 is a reply to message #1728117] Thu, 31 March 2016 08:41 Go to previous messageGo to next message
Eleanor Richie is currently offline Eleanor RichieFriend
Messages: 125
Registered: August 2014
Senior Member
but I noticed that declaration returns MyDeclaration has the EObject as a super type as well
Re: XMIException when binding two languages [message #1728121 is a reply to message #1728120] Thu, 31 March 2016 08:49 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14067
Registered: July 2009
Senior Member
yes. i think that is just a convention by the writer / generator of the grammar to write the type explicitely

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Generate includes for types referenced in body of inferred methods
Next Topic:XText 2.9 Generated Scope Provider Class
Goto Forum:
  


Current Time: Mon Sep 27 11:16:35 GMT 2021

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

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

Back to the top