Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xtend] Support for http://www.eclipse.org/emf/2003/XMLType dataTypes
[Xtend] Support for http://www.eclipse.org/emf/2003/XMLType dataTypes [message #634397] Thu, 21 October 2010 14:40 Go to next message
Jason Barkanic is currently offline Jason BarkanicFriend
Messages: 16
Registered: November 2009
Junior Member
I have an existing ecore model that uses the types defined in the http://www.eclipse.org/emf/2003/XMLType package (since it was once was imported from xsd).

Is there any existing support (that I can enable or use) for those types in Xtend?

For the types I've used so far (Name, String, Int) things seem to work at runtime (I think because the EMF metadamodel has a java metadatamodel as a backup), but my xtend files are full of errors.

If I do something like this, where name is http://www.eclipse.org/emf/2003/XMLType#Name
switch(something.name){
  case 'abc' : info('abc')
  case 'xyz' : info('xyz')
  default : info('unknown')
}

I get errors on the case statements saying "java::lang::String expected!" (but it works at runtime)

The same kind of thing happens for functions.
Re: [Xtend] Support for http://www.eclipse.org/emf/2003/XMLType dataTypes [message #638535 is a reply to message #634397] Thu, 11 November 2010 15:22 Go to previous message
Jason Barkanic is currently offline Jason BarkanicFriend
Messages: 16
Registered: November 2009
Junior Member
To help anyone coming across this later:

1.) I believe it is possible to extend xtend to handle these types. I know some of that functionality is in the 'XSD Adapter' (the problem is, I'm working with an Ecore model I created from XSD, not the actual xsd).

2.) I don't know how to do it.

3.) Although reading from the model seemed to work fine at runtime, and just cause errors in the syntax UI, writing to the model did not work at runtime. The easiest work around for all of this was to do a search and replace in my Ecore (as text), and just replace all the XML types with equivalent core Ecore types.
Previous Topic:[Xtend] Problems with editor's content assist
Next Topic:[Xtext] Generated Antlr parser artifacts
Goto Forum:
  


Current Time: Thu Sep 23 14:42:20 GMT 2021

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

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

Back to the top